init
This commit is contained in:
parent
51a38605ce
commit
c48baeaf5a
4
.vscode/settings.json
vendored
Normal file
4
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"editor.tabSize": 2,
|
||||
"editor.minimap.enabled": false
|
||||
}
|
21
Makefile
Normal file
21
Makefile
Normal file
@ -0,0 +1,21 @@
|
||||
include dev.env
|
||||
|
||||
migrateup:
|
||||
migrate -path db/migrations -database "${DB_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable" -verbose up
|
||||
|
||||
migratedown:
|
||||
migrate -path db/migrations -database "${DB_TYPE}://${DB_USERNAME}:${DB_PASSWORD}@${DB_HOST}:${DB_PORT}/${DB_NAME}?sslmode=disable" -verbose down $N
|
||||
|
||||
mock-generate:
|
||||
mockgen -package mockdb -destination db/mock/store.go git.nochill.in/nochill/naice_pos/db/sqlc Store
|
||||
|
||||
sqlc:
|
||||
sqlc generate && make mock-generate
|
||||
|
||||
test:
|
||||
go test -v -cover ./...
|
||||
|
||||
server:
|
||||
go run main.go
|
||||
|
||||
.PHONY: server migrateup migratedown sqlc
|
515
db/kabupaten.csv
Normal file
515
db/kabupaten.csv
Normal file
@ -0,0 +1,515 @@
|
||||
id,province_name,regency_name
|
||||
1101,11,Kabupaten Simeulue
|
||||
1102,11,Kabupaten Aceh Singkil
|
||||
1103,11,Kabupaten Aceh Selatan
|
||||
1104,11,Kabupaten Aceh Tenggara
|
||||
1105,11,Kabupaten Aceh Timur
|
||||
1106,11,Kabupaten Aceh Tengah
|
||||
1107,11,Kabupaten Aceh Barat
|
||||
1108,11,Kabupaten Aceh Besar
|
||||
1109,11,Kabupaten Pidie
|
||||
1110,11,Kabupaten Bireuen
|
||||
1111,11,Kabupaten Aceh Utara
|
||||
1112,11,Kabupaten Aceh Barat Daya
|
||||
1113,11,Kabupaten Gayo Lues
|
||||
1114,11,Kabupaten Aceh Tamiang
|
||||
1115,11,Kabupaten Nagan Raya
|
||||
1116,11,Kabupaten Aceh Jaya
|
||||
1117,11,Kabupaten Bener Meriah
|
||||
1118,11,Kabupaten Pidie Jaya
|
||||
1171,11,Kota Banda Aceh
|
||||
1172,11,Kota Sabang
|
||||
1173,11,Kota Langsa
|
||||
1174,11,Kota Lhokseumawe
|
||||
1175,11,Kota Subulussalam
|
||||
1201,12,Kabupaten Nias
|
||||
1202,12,Kabupaten Mandailing Natal
|
||||
1203,12,Kabupaten Tapanuli Selatan
|
||||
1204,12,Kabupaten Tapanuli Tengah
|
||||
1205,12,Kabupaten Tapanuli Utara
|
||||
1206,12,Kabupaten Toba Samosir
|
||||
1207,12,Kabupaten Labuhan Batu
|
||||
1208,12,Kabupaten Asahan
|
||||
1209,12,Kabupaten Simalungun
|
||||
1210,12,Kabupaten Dairi
|
||||
1211,12,Kabupaten Karo
|
||||
1212,12,Kabupaten Deli Serdang
|
||||
1213,12,Kabupaten Langkat
|
||||
1214,12,Kabupaten Nias Selatan
|
||||
1215,12,Kabupaten Humbang Hasundutan
|
||||
1216,12,Kabupaten Pakpak Bharat
|
||||
1217,12,Kabupaten Samosir
|
||||
1218,12,Kabupaten Serdang Bedagai
|
||||
1219,12,Kabupaten Batu Bara
|
||||
1220,12,Kabupaten Padang Lawas Utara
|
||||
1221,12,Kabupaten Padang Lawas
|
||||
1222,12,Kabupaten Labuhan Batu Selatan
|
||||
1223,12,Kabupaten Labuhan Batu Utara
|
||||
1224,12,Kabupaten Nias Utara
|
||||
1225,12,Kabupaten Nias Barat
|
||||
1271,12,Kota Sibolga
|
||||
1272,12,Kota Tanjung Balai
|
||||
1273,12,Kota Pematang Siantar
|
||||
1274,12,Kota Tebing Tinggi
|
||||
1275,12,Kota Medan
|
||||
1276,12,Kota Binjai
|
||||
1277,12,Kota Padangsidimpuan
|
||||
1278,12,Kota Gunungsitoli
|
||||
1301,13,Kabupaten Kepulauan Mentawai
|
||||
1302,13,Kabupaten Pesisir Selatan
|
||||
1303,13,Kabupaten Solok
|
||||
1304,13,Kabupaten Sijunjung
|
||||
1305,13,Kabupaten Tanah Datar
|
||||
1306,13,Kabupaten Padang Pariaman
|
||||
1307,13,Kabupaten Agam
|
||||
1308,13,Kabupaten Lima Puluh Kota
|
||||
1309,13,Kabupaten Pasaman
|
||||
1310,13,Kabupaten Solok Selatan
|
||||
1311,13,Kabupaten Dharmasraya
|
||||
1312,13,Kabupaten Pasaman Barat
|
||||
1371,13,Kota Padang
|
||||
1372,13,Kota Solok
|
||||
1373,13,Kota Sawah Lunto
|
||||
1374,13,Kota Padang Panjang
|
||||
1375,13,Kota Bukittinggi
|
||||
1376,13,Kota Payakumbuh
|
||||
1377,13,Kota Pariaman
|
||||
1401,14,Kabupaten Kuantan Singingi
|
||||
1402,14,Kabupaten Indragiri Hulu
|
||||
1403,14,Kabupaten Indragiri Hilir
|
||||
1404,14,Kabupaten Pelalawan
|
||||
1405,14,Kabupaten Siak
|
||||
1406,14,Kabupaten Kampar
|
||||
1407,14,Kabupaten Rokan Hulu
|
||||
1408,14,Kabupaten Bengkalis
|
||||
1409,14,Kabupaten Rokan Hilir
|
||||
1410,14,Kabupaten Kepulauan Meranti
|
||||
1471,14,Kota Pekanbaru
|
||||
1473,14,Kota Dumai
|
||||
1501,15,Kabupaten Kerinci
|
||||
1502,15,Kabupaten Merangin
|
||||
1503,15,Kabupaten Sarolangun
|
||||
1504,15,Kabupaten Batang Hari
|
||||
1505,15,Kabupaten Muaro Jambi
|
||||
1506,15,Kabupaten Tanjung Jabung Timur
|
||||
1507,15,Kabupaten Tanjung Jabung Barat
|
||||
1508,15,Kabupaten Tebo
|
||||
1509,15,Kabupaten Bungo
|
||||
1571,15,Kota Jambi
|
||||
1572,15,Kota Sungai Penuh
|
||||
1601,16,Kabupaten Ogan Komering Ulu
|
||||
1602,16,Kabupaten Ogan Komering Ilir
|
||||
1603,16,Kabupaten Muara Enim
|
||||
1604,16,Kabupaten Lahat
|
||||
1605,16,Kabupaten Musi Rawas
|
||||
1606,16,Kabupaten Musi Banyuasin
|
||||
1607,16,Kabupaten Banyu Asin
|
||||
1608,16,Kabupaten Ogan Komering Ulu Selatan
|
||||
1609,16,Kabupaten Ogan Komering Ulu Timur
|
||||
1610,16,Kabupaten Ogan Ilir
|
||||
1611,16,Kabupaten Empat Lawang
|
||||
1612,16,Kabupaten Penukal Abab Lematang Ilir
|
||||
1613,16,Kabupaten Musi Rawas Utara
|
||||
1671,16,Kota Palembang
|
||||
1672,16,Kota Prabumulih
|
||||
1673,16,Kota Pagar Alam
|
||||
1674,16,Kota Lubuklinggau
|
||||
1701,17,Kabupaten Bengkulu Selatan
|
||||
1702,17,Kabupaten Rejang Lebong
|
||||
1703,17,Kabupaten Bengkulu Utara
|
||||
1704,17,Kabupaten Kaur
|
||||
1705,17,Kabupaten Seluma
|
||||
1706,17,Kabupaten Mukomuko
|
||||
1707,17,Kabupaten Lebong
|
||||
1708,17,Kabupaten Kepahiang
|
||||
1709,17,Kabupaten Bengkulu Tengah
|
||||
1771,17,Kota Bengkulu
|
||||
1801,18,Kabupaten Lampung Barat
|
||||
1802,18,Kabupaten Tanggamus
|
||||
1803,18,Kabupaten Lampung Selatan
|
||||
1804,18,Kabupaten Lampung Timur
|
||||
1805,18,Kabupaten Lampung Tengah
|
||||
1806,18,Kabupaten Lampung Utara
|
||||
1807,18,Kabupaten Way Kanan
|
||||
1808,18,Kabupaten Tulangbawang
|
||||
1809,18,Kabupaten Pesawaran
|
||||
1810,18,Kabupaten Pringsewu
|
||||
1811,18,Kabupaten Mesuji
|
||||
1812,18,Kabupaten Tulang Bawang Barat
|
||||
1813,18,Kabupaten Pesisir Barat
|
||||
1871,18,Kota Bandar Lampung
|
||||
1872,18,Kota Metro
|
||||
1901,19,Kabupaten Bangka
|
||||
1902,19,Kabupaten Belitung
|
||||
1903,19,Kabupaten Bangka Barat
|
||||
1904,19,Kabupaten Bangka Tengah
|
||||
1905,19,Kabupaten Bangka Selatan
|
||||
1906,19,Kabupaten Belitung Timur
|
||||
1971,19,Kota Pangkal Pinang
|
||||
2101,21,Kabupaten Karimun
|
||||
2102,21,Kabupaten Bintan
|
||||
2103,21,Kabupaten Natuna
|
||||
2104,21,Kabupaten Lingga
|
||||
2105,21,Kabupaten Kepulauan Anambas
|
||||
2171,21,Kota Batam
|
||||
2172,21,Kota Tanjung Pinang
|
||||
3101,31,Kabupaten Kepulauan Seribu
|
||||
3171,31,Kota Jakarta Selatan
|
||||
3172,31,Kota Jakarta Timur
|
||||
3173,31,Kota Jakarta Pusat
|
||||
3174,31,Kota Jakarta Barat
|
||||
3175,31,Kota Jakarta Utara
|
||||
3201,32,Kabupaten Bogor
|
||||
3202,32,Kabupaten Sukabumi
|
||||
3203,32,Kabupaten Cianjur
|
||||
3204,32,Kabupaten Bandung
|
||||
3205,32,Kabupaten Garut
|
||||
3206,32,Kabupaten Tasikmalaya
|
||||
3207,32,Kabupaten Ciamis
|
||||
3208,32,Kabupaten Kuningan
|
||||
3209,32,Kabupaten Cirebon
|
||||
3210,32,Kabupaten Majalengka
|
||||
3211,32,Kabupaten Sumedang
|
||||
3212,32,Kabupaten Indramayu
|
||||
3213,32,Kabupaten Subang
|
||||
3214,32,Kabupaten Purwakarta
|
||||
3215,32,Kabupaten Karawang
|
||||
3216,32,Kabupaten Bekasi
|
||||
3217,32,Kabupaten Bandung Barat
|
||||
3218,32,Kabupaten Pangandaran
|
||||
3271,32,Kota Bogor
|
||||
3272,32,Kota Sukabumi
|
||||
3273,32,Kota Bandung
|
||||
3274,32,Kota Cirebon
|
||||
3275,32,Kota Bekasi
|
||||
3276,32,Kota Depok
|
||||
3277,32,Kota Cimahi
|
||||
3278,32,Kota Tasikmalaya
|
||||
3279,32,Kota Banjar
|
||||
3301,33,Kabupaten Cilacap
|
||||
3302,33,Kabupaten Banyumas
|
||||
3303,33,Kabupaten Purbalingga
|
||||
3304,33,Kabupaten Banjarnegara
|
||||
3305,33,Kabupaten Kebumen
|
||||
3306,33,Kabupaten Purworejo
|
||||
3307,33,Kabupaten Wonosobo
|
||||
3308,33,Kabupaten Magelang
|
||||
3309,33,Kabupaten Boyolali
|
||||
3310,33,Kabupaten Klaten
|
||||
3311,33,Kabupaten Sukoharjo
|
||||
3312,33,Kabupaten Wonogiri
|
||||
3313,33,Kabupaten Karanganyar
|
||||
3314,33,Kabupaten Sragen
|
||||
3315,33,Kabupaten Grobogan
|
||||
3316,33,Kabupaten Blora
|
||||
3317,33,Kabupaten Rembang
|
||||
3318,33,Kabupaten Pati
|
||||
3319,33,Kabupaten Kudus
|
||||
3320,33,Kabupaten Jepara
|
||||
3321,33,Kabupaten Demak
|
||||
3322,33,Kabupaten Semarang
|
||||
3323,33,Kabupaten Temanggung
|
||||
3324,33,Kabupaten Kendal
|
||||
3325,33,Kabupaten Batang
|
||||
3326,33,Kabupaten Pekalongan
|
||||
3327,33,Kabupaten Pemalang
|
||||
3328,33,Kabupaten Tegal
|
||||
3329,33,Kabupaten Brebes
|
||||
3371,33,Kota Magelang
|
||||
3372,33,Kota Surakarta
|
||||
3373,33,Kota Salatiga
|
||||
3374,33,Kota Semarang
|
||||
3375,33,Kota Pekalongan
|
||||
3376,33,Kota Tegal
|
||||
3401,34,Kabupaten Kulon Progo
|
||||
3402,34,Kabupaten Bantul
|
||||
3403,34,Kabupaten Gunung Kidul
|
||||
3404,34,Kabupaten Sleman
|
||||
3471,34,Kota Yogyakarta
|
||||
3501,35,Kabupaten Pacitan
|
||||
3502,35,Kabupaten Ponorogo
|
||||
3503,35,Kabupaten Trenggalek
|
||||
3504,35,Kabupaten Tulungagung
|
||||
3505,35,Kabupaten Blitar
|
||||
3506,35,Kabupaten Kediri
|
||||
3507,35,Kabupaten Malang
|
||||
3508,35,Kabupaten Lumajang
|
||||
3509,35,Kabupaten Jember
|
||||
3510,35,Kabupaten Banyuwangi
|
||||
3511,35,Kabupaten Bondowoso
|
||||
3512,35,Kabupaten Situbondo
|
||||
3513,35,Kabupaten Probolinggo
|
||||
3514,35,Kabupaten Pasuruan
|
||||
3515,35,Kabupaten Sidoarjo
|
||||
3516,35,Kabupaten Mojokerto
|
||||
3517,35,Kabupaten Jombang
|
||||
3518,35,Kabupaten Nganjuk
|
||||
3519,35,Kabupaten Madiun
|
||||
3520,35,Kabupaten Magetan
|
||||
3521,35,Kabupaten Ngawi
|
||||
3522,35,Kabupaten Bojonegoro
|
||||
3523,35,Kabupaten Tuban
|
||||
3524,35,Kabupaten Lamongan
|
||||
3525,35,Kabupaten Gresik
|
||||
3526,35,Kabupaten Bangkalan
|
||||
3527,35,Kabupaten Sampang
|
||||
3528,35,Kabupaten Pamekasan
|
||||
3529,35,Kabupaten Sumenep
|
||||
3571,35,Kota Kediri
|
||||
3572,35,Kota Blitar
|
||||
3573,35,Kota Malang
|
||||
3574,35,Kota Probolinggo
|
||||
3575,35,Kota Pasuruan
|
||||
3576,35,Kota Mojokerto
|
||||
3577,35,Kota Madiun
|
||||
3578,35,Kota Surabaya
|
||||
3579,35,Kota Batu
|
||||
3601,36,Kabupaten Pandeglang
|
||||
3602,36,Kabupaten Lebak
|
||||
3603,36,Kabupaten Tangerang
|
||||
3604,36,Kabupaten Serang
|
||||
3671,36,Kota Tangerang
|
||||
3672,36,Kota Cilegon
|
||||
3673,36,Kota Serang
|
||||
3674,36,Kota Tangerang Selatan
|
||||
5101,51,Kabupaten Jembrana
|
||||
5102,51,Kabupaten Tabanan
|
||||
5103,51,Kabupaten Badung
|
||||
5104,51,Kabupaten Gianyar
|
||||
5105,51,Kabupaten Klungkung
|
||||
5106,51,Kabupaten Bangli
|
||||
5107,51,Kabupaten Karang Asem
|
||||
5108,51,Kabupaten Buleleng
|
||||
5171,51,Kota Denpasar
|
||||
5201,52,Kabupaten Lombok Barat
|
||||
5202,52,Kabupaten Lombok Tengah
|
||||
5203,52,Kabupaten Lombok Timur
|
||||
5204,52,Kabupaten Sumbawa
|
||||
5205,52,Kabupaten Dompu
|
||||
5206,52,Kabupaten Bima
|
||||
5207,52,Kabupaten Sumbawa Barat
|
||||
5208,52,Kabupaten Lombok Utara
|
||||
5271,52,Kota Mataram
|
||||
5272,52,Kota Bima
|
||||
5301,53,Kabupaten Sumba Barat
|
||||
5302,53,Kabupaten Sumba Timur
|
||||
5303,53,Kabupaten Kupang
|
||||
5304,53,Kabupaten Timor Tengah Selatan
|
||||
5305,53,Kabupaten Timor Tengah Utara
|
||||
5306,53,Kabupaten Belu
|
||||
5307,53,Kabupaten Alor
|
||||
5308,53,Kabupaten Lembata
|
||||
5309,53,Kabupaten Flores Timur
|
||||
5310,53,Kabupaten Sikka
|
||||
5311,53,Kabupaten Ende
|
||||
5312,53,Kabupaten Ngada
|
||||
5313,53,Kabupaten Manggarai
|
||||
5314,53,Kabupaten Rote Ndao
|
||||
5315,53,Kabupaten Manggarai Barat
|
||||
5316,53,Kabupaten Sumba Tengah
|
||||
5317,53,Kabupaten Sumba Barat Daya
|
||||
5318,53,Kabupaten Nagekeo
|
||||
5319,53,Kabupaten Manggarai Timur
|
||||
5320,53,Kabupaten Sabu Raijua
|
||||
5321,53,Kabupaten Malaka
|
||||
5371,53,Kota Kupang
|
||||
6101,61,Kabupaten Sambas
|
||||
6102,61,Kabupaten Bengkayang
|
||||
6103,61,Kabupaten Landak
|
||||
6104,61,Kabupaten Mempawah
|
||||
6105,61,Kabupaten Sanggau
|
||||
6106,61,Kabupaten Ketapang
|
||||
6107,61,Kabupaten Sintang
|
||||
6108,61,Kabupaten Kapuas Hulu
|
||||
6109,61,Kabupaten Sekadau
|
||||
6110,61,Kabupaten Melawi
|
||||
6111,61,Kabupaten Kayong Utara
|
||||
6112,61,Kabupaten Kubu Raya
|
||||
6171,61,Kota Pontianak
|
||||
6172,61,Kota Singkawang
|
||||
6201,62,Kabupaten Kotawaringin Barat
|
||||
6202,62,Kabupaten Kotawaringin Timur
|
||||
6203,62,Kabupaten Kapuas
|
||||
6204,62,Kabupaten Barito Selatan
|
||||
6205,62,Kabupaten Barito Utara
|
||||
6206,62,Kabupaten Sukamara
|
||||
6207,62,Kabupaten Lamandau
|
||||
6208,62,Kabupaten Seruyan
|
||||
6209,62,Kabupaten Katingan
|
||||
6210,62,Kabupaten Pulang Pisau
|
||||
6211,62,Kabupaten Gunung Mas
|
||||
6212,62,Kabupaten Barito Timur
|
||||
6213,62,Kabupaten Murung Raya
|
||||
6271,62,Kota Palangka Raya
|
||||
6301,63,Kabupaten Tanah Laut
|
||||
6302,63,Kabupaten Kota Baru
|
||||
6303,63,Kabupaten Banjar
|
||||
6304,63,Kabupaten Barito Kuala
|
||||
6305,63,Kabupaten Tapin
|
||||
6306,63,Kabupaten Hulu Sungai Selatan
|
||||
6307,63,Kabupaten Hulu Sungai Tengah
|
||||
6308,63,Kabupaten Hulu Sungai Utara
|
||||
6309,63,Kabupaten Tabalong
|
||||
6310,63,Kabupaten Tanah Bumbu
|
||||
6311,63,Kabupaten Balangan
|
||||
6371,63,Kota Banjarmasin
|
||||
6372,63,Kota Banjar Baru
|
||||
6401,64,Kabupaten Paser
|
||||
6402,64,Kabupaten Kutai Barat
|
||||
6403,64,Kabupaten Kutai Kartanegara
|
||||
6404,64,Kabupaten Kutai Timur
|
||||
6405,64,Kabupaten Berau
|
||||
6409,64,Kabupaten Penajam Paser Utara
|
||||
6411,64,Kabupaten Mahakam Hulu
|
||||
6471,64,Kota Balikpapan
|
||||
6472,64,Kota Samarinda
|
||||
6474,64,Kota Bontang
|
||||
6501,65,Kabupaten Malinau
|
||||
6502,65,Kabupaten Bulungan
|
||||
6503,65,Kabupaten Tana Tidung
|
||||
6504,65,Kabupaten Nunukan
|
||||
6571,65,Kota Tarakan
|
||||
7101,71,Kabupaten Bolaang Mongondow
|
||||
7102,71,Kabupaten Minahasa
|
||||
7103,71,Kabupaten Kepulauan Sangihe
|
||||
7104,71,Kabupaten Kepulauan Talaud
|
||||
7105,71,Kabupaten Minahasa Selatan
|
||||
7106,71,Kabupaten Minahasa Utara
|
||||
7107,71,Kabupaten Bolaang Mongondow Utara
|
||||
7108,71,Kabupaten Siau Tagulandang Biaro
|
||||
7109,71,Kabupaten Minahasa Tenggara
|
||||
7110,71,Kabupaten Bolaang Mongondow Selatan
|
||||
7111,71,Kabupaten Bolaang Mongondow Timur
|
||||
7171,71,Kota Manado
|
||||
7172,71,Kota Bitung
|
||||
7173,71,Kota Tomohon
|
||||
7174,71,Kota Kotamobagu
|
||||
7201,72,Kabupaten Banggai Kepulauan
|
||||
7202,72,Kabupaten Banggai
|
||||
7203,72,Kabupaten Morowali
|
||||
7204,72,Kabupaten Poso
|
||||
7205,72,Kabupaten Donggala
|
||||
7206,72,Kabupaten Toli-Toli
|
||||
7207,72,Kabupaten Buol
|
||||
7208,72,Kabupaten Parigi Moutong
|
||||
7209,72,Kabupaten Tojo Una-Una
|
||||
7210,72,Kabupaten Sigi
|
||||
7211,72,Kabupaten Banggai Laut
|
||||
7212,72,Kabupaten Morowali Utara
|
||||
7271,72,Kota Palu
|
||||
7301,73,Kabupaten Kepulauan Selayar
|
||||
7302,73,Kabupaten Bulukumba
|
||||
7303,73,Kabupaten Bantaeng
|
||||
7304,73,Kabupaten Jeneponto
|
||||
7305,73,Kabupaten Takalar
|
||||
7306,73,Kabupaten Gowa
|
||||
7307,73,Kabupaten Sinjai
|
||||
7308,73,Kabupaten Maros
|
||||
7309,73,Kabupaten Pangkajene Dan Kepulauan
|
||||
7310,73,Kabupaten Barru
|
||||
7311,73,Kabupaten Bone
|
||||
7312,73,Kabupaten Soppeng
|
||||
7313,73,Kabupaten Wajo
|
||||
7314,73,Kabupaten Sidenreng Rappang
|
||||
7315,73,Kabupaten Pinrang
|
||||
7316,73,Kabupaten Enrekang
|
||||
7317,73,Kabupaten Luwu
|
||||
7318,73,Kabupaten Tana Toraja
|
||||
7322,73,Kabupaten Luwu Utara
|
||||
7325,73,Kabupaten Luwu Timur
|
||||
7326,73,Kabupaten Toraja Utara
|
||||
7371,73,Kota Makassar
|
||||
7372,73,Kota Parepare
|
||||
7373,73,Kota Palopo
|
||||
7401,74,Kabupaten Buton
|
||||
7402,74,Kabupaten Muna
|
||||
7403,74,Kabupaten Konawe
|
||||
7404,74,Kabupaten Kolaka
|
||||
7405,74,Kabupaten Konawe Selatan
|
||||
7406,74,Kabupaten Bombana
|
||||
7407,74,Kabupaten Wakatobi
|
||||
7408,74,Kabupaten Kolaka Utara
|
||||
7409,74,Kabupaten Buton Utara
|
||||
7410,74,Kabupaten Konawe Utara
|
||||
7411,74,Kabupaten Kolaka Timur
|
||||
7412,74,Kabupaten Konawe Kepulauan
|
||||
7413,74,Kabupaten Muna Barat
|
||||
7414,74,Kabupaten Buton Tengah
|
||||
7415,74,Kabupaten Buton Selatan
|
||||
7471,74,Kota Kendari
|
||||
7472,74,Kota Baubau
|
||||
7501,75,Kabupaten Boalemo
|
||||
7502,75,Kabupaten Gorontalo
|
||||
7503,75,Kabupaten Pohuwato
|
||||
7504,75,Kabupaten Bone Bolango
|
||||
7505,75,Kabupaten Gorontalo Utara
|
||||
7571,75,Kota Gorontalo
|
||||
7601,76,Kabupaten Majene
|
||||
7602,76,Kabupaten Polewali Mandar
|
||||
7603,76,Kabupaten Mamasa
|
||||
7604,76,Kabupaten Mamuju
|
||||
7605,76,Kabupaten Mamuju Utara
|
||||
7606,76,Kabupaten Mamuju Tengah
|
||||
8101,81,Kabupaten Maluku Tenggara Barat
|
||||
8102,81,Kabupaten Maluku Tenggara
|
||||
8103,81,Kabupaten Maluku Tengah
|
||||
8104,81,Kabupaten Buru
|
||||
8105,81,Kabupaten Kepulauan Aru
|
||||
8106,81,Kabupaten Seram Bagian Barat
|
||||
8107,81,Kabupaten Seram Bagian Timur
|
||||
8108,81,Kabupaten Maluku Barat Daya
|
||||
8109,81,Kabupaten Buru Selatan
|
||||
8171,81,Kota Ambon
|
||||
8172,81,Kota Tual
|
||||
8201,82,Kabupaten Halmahera Barat
|
||||
8202,82,Kabupaten Halmahera Tengah
|
||||
8203,82,Kabupaten Kepulauan Sula
|
||||
8204,82,Kabupaten Halmahera Selatan
|
||||
8205,82,Kabupaten Halmahera Utara
|
||||
8206,82,Kabupaten Halmahera Timur
|
||||
8207,82,Kabupaten Pulau Morotai
|
||||
8208,82,Kabupaten Pulau Taliabu
|
||||
8271,82,Kota Ternate
|
||||
8272,82,Kota Tidore Kepulauan
|
||||
9101,91,Kabupaten Fakfak
|
||||
9102,91,Kabupaten Kaimana
|
||||
9103,91,Kabupaten Teluk Wondama
|
||||
9104,91,Kabupaten Teluk Bintuni
|
||||
9105,91,Kabupaten Manokwari
|
||||
9106,91,Kabupaten Sorong Selatan
|
||||
9107,91,Kabupaten Sorong
|
||||
9108,91,Kabupaten Raja Ampat
|
||||
9109,91,Kabupaten Tambrauw
|
||||
9110,91,Kabupaten Maybrat
|
||||
9111,91,Kabupaten Manokwari Selatan
|
||||
9112,91,Kabupaten Pegunungan Arfak
|
||||
9171,91,Kota Sorong
|
||||
9401,94,Kabupaten Merauke
|
||||
9402,94,Kabupaten Jayawijaya
|
||||
9403,94,Kabupaten Jayapura
|
||||
9404,94,Kabupaten Nabire
|
||||
9408,94,Kabupaten Kepulauan Yapen
|
||||
9409,94,Kabupaten Biak Numfor
|
||||
9410,94,Kabupaten Paniai
|
||||
9411,94,Kabupaten Puncak Jaya
|
||||
9412,94,Kabupaten Mimika
|
||||
9413,94,Kabupaten Boven Digoel
|
||||
9414,94,Kabupaten Mappi
|
||||
9415,94,Kabupaten Asmat
|
||||
9416,94,Kabupaten Yahukimo
|
||||
9417,94,Kabupaten Pegunungan Bintang
|
||||
9418,94,Kabupaten Tolikara
|
||||
9419,94,Kabupaten Sarmi
|
||||
9420,94,Kabupaten Keerom
|
||||
9426,94,Kabupaten Waropen
|
||||
9427,94,Kabupaten Supiori
|
||||
9428,94,Kabupaten Mamberamo Raya
|
||||
9429,94,Kabupaten Nduga
|
||||
9430,94,Kabupaten Lanny Jaya
|
||||
9431,94,Kabupaten Mamberamo Tengah
|
||||
9432,94,Kabupaten Yalimo
|
||||
9433,94,Kabupaten Puncak
|
||||
9434,94,Kabupaten Dogiyai
|
||||
9435,94,Kabupaten Intan Jaya
|
||||
9436,94,Kabupaten Deiyai
|
||||
9471,94,Kota Jayapura
|
|
8
db/migrations/000001_init_schema.down.sql
Normal file
8
db/migrations/000001_init_schema.down.sql
Normal file
@ -0,0 +1,8 @@
|
||||
DROP TABLE IF EXISTS location_images;
|
||||
DROP TABLE IF EXISTS reviews;
|
||||
DROP TABLE IF EXISTS locations;
|
||||
DROP TABLE IF EXISTS regencies;
|
||||
DROP TABLE IF EXISTS provinces;
|
||||
DROP TABLE IF EXISTS regions;
|
||||
DROP TABLE IF EXISTS tags;
|
||||
DROP TABLE IF EXISTS users;
|
84
db/migrations/000001_init_schema.up.sql
Normal file
84
db/migrations/000001_init_schema.up.sql
Normal file
@ -0,0 +1,84 @@
|
||||
CREATE TABLE users(
|
||||
"id" serial primary key not null,
|
||||
"email" varchar unique,
|
||||
"username" varchar unique,
|
||||
"password" varchar,
|
||||
"avatar_picture" varchar,
|
||||
"google_sign_in_payload" varchar,
|
||||
"banned_at" timestamp,
|
||||
"banned_until" timestamp,
|
||||
"is_admin" boolean,
|
||||
"is_critics" boolean,
|
||||
"is_verified" boolean,
|
||||
"ip_address" varchar(15),
|
||||
"social_media" jsonb,
|
||||
"created_at" timestamp default(now()),
|
||||
"updated_at" timestamp default(now())
|
||||
);
|
||||
|
||||
CREATE TABLE regions(
|
||||
"id" serial primary key not null,
|
||||
"region_name" varchar,
|
||||
"created_at" timestamp default(now()),
|
||||
"updated_at" timestamp default(now())
|
||||
);
|
||||
|
||||
CREATE TABLE provinces(
|
||||
"id" serial primary key not null,
|
||||
"province_name" varchar,
|
||||
"region_id" smallint references "regions"("id") not null,
|
||||
"created_at" timestamp default(now()),
|
||||
"updated_at" timestamp default(now())
|
||||
);
|
||||
|
||||
CREATE TABLE regencies(
|
||||
"id" serial primary key not null,
|
||||
"regency_name" varchar,
|
||||
"province_id" smallint references "provinces"("id") not null,
|
||||
"created_at" timestamp default(now()),
|
||||
"updated_at" timestamp default(now())
|
||||
);
|
||||
|
||||
CREATE TABLE locations(
|
||||
"id" serial primary key not null,
|
||||
"address" varchar,
|
||||
"name" varchar,
|
||||
"google_maps_link" varchar,
|
||||
"submitted_by" integer references "users"("id") not null,
|
||||
"total_visited" integer,
|
||||
"thumbnail" varchar,
|
||||
"regency_id" smallint references "regencies"("id") not null,
|
||||
"is_deleted" boolean,
|
||||
"created_at" timestamp default(now()),
|
||||
"updated_at" timestamp default(now())
|
||||
);
|
||||
|
||||
CREATE TABLE tags (
|
||||
"id" serial primary key not null,
|
||||
"name" varchar(50) not null,
|
||||
"target_id" integer,
|
||||
"tags_type" varchar(20),
|
||||
"created_at" timestamp default(now()),
|
||||
"updated_at" timestamp default(now())
|
||||
);
|
||||
|
||||
CREATE TABLE location_images (
|
||||
"id" serial primary key not null,
|
||||
"url" varchar not null,
|
||||
"location_id" integer references "locations"("id") not null,
|
||||
"uploaded_by" integer references "users"("id"),
|
||||
"created_at" timestamp default(now()),
|
||||
"updated_at" timestamp default(now())
|
||||
);
|
||||
|
||||
CREATE TABLE reviews (
|
||||
"id" serial primary key not null,
|
||||
"submitted_by" integer references "users"("id") not null,
|
||||
"comments" text not null,
|
||||
"score" smallint not null,
|
||||
"is_hided" boolean, -- if comments violate TOS just hide the reviews
|
||||
"location_id" integer references "locations"("id") not null,
|
||||
"created_at" timestamp default(now()),
|
||||
"updated_at" timestamp default(now())
|
||||
|
||||
);
|
35
db/provinsi.csv
Normal file
35
db/provinsi.csv
Normal file
@ -0,0 +1,35 @@
|
||||
id,province_name,region_id
|
||||
11,Aceh,1
|
||||
12,Sumatera Utara,1
|
||||
13,Sumatera Barat,1
|
||||
14,Riau,1
|
||||
15,Jambi,1
|
||||
16,Sumatera Selatan,1
|
||||
17,Bengkulu,1
|
||||
18,Lampung,1
|
||||
19,Kepulauan Bangka Belitung,1
|
||||
21,Kepulauan Riau,1
|
||||
31,DKI Jakarta,2
|
||||
32,Jawa Barat,2
|
||||
33,Jawa Tengah,2
|
||||
34,DI Yogyakarta,2
|
||||
35,Jawa Timur,2
|
||||
36,Banten,2
|
||||
51,Bali,4
|
||||
52,Nusa Tenggara Barat,4
|
||||
53,Nusa Tenggara Timur,4
|
||||
61,Kalimantan Barat,3
|
||||
62,Kalimantan Tengah,3
|
||||
63,Kalimantan Selatan,3
|
||||
64,Kalimantan Timur,3
|
||||
65,Kalimantan Utara,3
|
||||
71,Sulawesi Utara,5
|
||||
72,Sulawesi Tengah,5
|
||||
73,Sulawesi Selatan,5
|
||||
74,Sulawesi Tenggara,5
|
||||
75,Gorontalo,5
|
||||
76,Sulawesi Barat,5
|
||||
81,Maluku,6
|
||||
82,Maluku Utara,6
|
||||
91,Papua Barat,7
|
||||
94,Papua,7
|
|
8
db/regions.csv
Normal file
8
db/regions.csv
Normal file
@ -0,0 +1,8 @@
|
||||
id,region_name
|
||||
1,Sumatera
|
||||
2,Jawa
|
||||
3,Kalimantan
|
||||
4,Nusa Tenggara
|
||||
5,Sulawes
|
||||
6,Maluku
|
||||
7,Papua
|
|
13
dev.env.example
Normal file
13
dev.env.example
Normal file
@ -0,0 +1,13 @@
|
||||
DB_TYPE=postgres
|
||||
DB_USERNAME=postgres
|
||||
DB_PASSWORD=password
|
||||
DB_NAME=dbname
|
||||
DB_HOST=localhost
|
||||
DB_PORT=5432
|
||||
|
||||
DB_SOURCE = postgresql://postgres:password@localhost:5432/dbname?sslmode=disable
|
||||
SERVER_ADDRESS = 0.0.0.0:8888
|
||||
|
||||
TOKEN_SYMMETRIC_KEY=
|
||||
TOKEN_DURATION = 1024h
|
||||
REFRESH_TOKEN_DURATION = 1024h
|
32
go.mod
Normal file
32
go.mod
Normal file
@ -0,0 +1,32 @@
|
||||
module git.nochill.in/nochill/hiling_go
|
||||
|
||||
go 1.20
|
||||
|
||||
require (
|
||||
github.com/bytedance/sonic v1.10.0 // indirect
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d // indirect
|
||||
github.com/chenzhuoyu/iasm v0.9.0 // indirect
|
||||
github.com/gabriel-vasile/mimetype v1.4.2 // indirect
|
||||
github.com/gin-contrib/sse v0.1.0 // indirect
|
||||
github.com/gin-gonic/gin v1.9.1 // indirect
|
||||
github.com/go-playground/locales v0.14.1 // indirect
|
||||
github.com/go-playground/universal-translator v0.18.1 // indirect
|
||||
github.com/go-playground/validator/v10 v10.15.3 // indirect
|
||||
github.com/goccy/go-json v0.10.2 // indirect
|
||||
github.com/json-iterator/go v1.1.12 // indirect
|
||||
github.com/klauspost/cpuid/v2 v2.2.5 // indirect
|
||||
github.com/leodido/go-urn v1.2.4 // indirect
|
||||
github.com/mattn/go-isatty v0.0.19 // indirect
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd // indirect
|
||||
github.com/modern-go/reflect2 v1.0.2 // indirect
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 // indirect
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 // indirect
|
||||
github.com/ugorji/go/codec v1.2.11 // indirect
|
||||
golang.org/x/arch v0.5.0 // indirect
|
||||
golang.org/x/crypto v0.12.0 // indirect
|
||||
golang.org/x/net v0.14.0 // indirect
|
||||
golang.org/x/sys v0.12.0 // indirect
|
||||
golang.org/x/text v0.13.0 // indirect
|
||||
google.golang.org/protobuf v1.31.0 // indirect
|
||||
gopkg.in/yaml.v3 v3.0.1 // indirect
|
||||
)
|
84
go.sum
Normal file
84
go.sum
Normal file
@ -0,0 +1,84 @@
|
||||
github.com/bytedance/sonic v1.5.0/go.mod h1:ED5hyg4y6t3/9Ku1R6dU/4KyJ48DZ4jPhfY1O2AihPM=
|
||||
github.com/bytedance/sonic v1.10.0-rc/go.mod h1:ElCzW+ufi8qKqNW0FY314xriJhyJhuoJ3gFZdAHF7NM=
|
||||
github.com/bytedance/sonic v1.10.0 h1:qtNZduETEIWJVIyDl01BeNxur2rW9OwTQ/yBqFRkKEk=
|
||||
github.com/bytedance/sonic v1.10.0/go.mod h1:iZcSUejdk5aukTND/Eu/ivjQuEL0Cu9/rf50Hi0u/g4=
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20211019084208-fb5309c8db06/go.mod h1:DH46F32mSOjUmXrMHnKwZdA8wcEefY7UVqBKYGjpdQY=
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20221115062448-fe3a3abad311/go.mod h1:b583jCggY9gE99b6G5LEC39OIiVsWj+R97kbl5odCEk=
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d h1:77cEq6EriyTZ0g/qfRdp61a3Uu/AWrgIq2s0ClJV1g0=
|
||||
github.com/chenzhuoyu/base64x v0.0.0-20230717121745-296ad89f973d/go.mod h1:8EPpVsBuRksnlj1mLy4AWzRNQYxauNi62uWcE3to6eA=
|
||||
github.com/chenzhuoyu/iasm v0.9.0 h1:9fhXjVzq5hUy2gkhhgHl95zG2cEAhw9OSGs8toWWAwo=
|
||||
github.com/chenzhuoyu/iasm v0.9.0/go.mod h1:Xjy2NpN3h7aUqeqM+woSuuvxmIe6+DDsiNLIrkAmYog=
|
||||
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
|
||||
github.com/gabriel-vasile/mimetype v1.4.2 h1:w5qFW6JKBz9Y393Y4q372O9A7cUSequkh1Q7OhCmWKU=
|
||||
github.com/gabriel-vasile/mimetype v1.4.2/go.mod h1:zApsH/mKG4w07erKIaJPFiX0Tsq9BFQgN3qGY5GnNgA=
|
||||
github.com/gin-contrib/sse v0.1.0 h1:Y/yl/+YNO8GZSjAhjMsSuLt29uWRFHdHYUb5lYOV9qE=
|
||||
github.com/gin-contrib/sse v0.1.0/go.mod h1:RHrZQHXnP2xjPF+u1gW/2HnVO7nvIa9PG3Gm+fLHvGI=
|
||||
github.com/gin-gonic/gin v1.9.1 h1:4idEAncQnU5cB7BeOkPtxjfCSye0AAm1R0RVIqJ+Jmg=
|
||||
github.com/gin-gonic/gin v1.9.1/go.mod h1:hPrL7YrpYKXt5YId3A/Tnip5kqbEAP+KLuI3SUcPTeU=
|
||||
github.com/go-playground/locales v0.14.1 h1:EWaQ/wswjilfKLTECiXz7Rh+3BjFhfDFKv/oXslEjJA=
|
||||
github.com/go-playground/locales v0.14.1/go.mod h1:hxrqLVvrK65+Rwrd5Fc6F2O76J/NuW9t0sjnWqG1slY=
|
||||
github.com/go-playground/universal-translator v0.18.1 h1:Bcnm0ZwsGyWbCzImXv+pAJnYK9S473LQFuzCbDbfSFY=
|
||||
github.com/go-playground/universal-translator v0.18.1/go.mod h1:xekY+UJKNuX9WP91TpwSH2VMlDf28Uj24BCp08ZFTUY=
|
||||
github.com/go-playground/validator/v10 v10.15.3 h1:S+sSpunYjNPDuXkWbK+x+bA7iXiW296KG4dL3X7xUZo=
|
||||
github.com/go-playground/validator/v10 v10.15.3/go.mod h1:9iXMNT7sEkjXb0I+enO7QXmzG6QCsPWY4zveKFVRSyU=
|
||||
github.com/goccy/go-json v0.10.2 h1:CrxCmQqYDkv1z7lO7Wbh2HN93uovUHgrECaO5ZrCXAU=
|
||||
github.com/goccy/go-json v0.10.2/go.mod h1:6MelG93GURQebXPDq3khkgXZkazVtN9CRI+MGFi0w8I=
|
||||
github.com/golang/protobuf v1.5.0/go.mod h1:FsONVRAS9T7sI+LIUmWTfcYkHO4aIWwzhcaSAoJOfIk=
|
||||
github.com/google/go-cmp v0.5.5/go.mod h1:v8dTdLbMG2kIc/vJvl+f65V22dbkXbowE6jgT/gNBxE=
|
||||
github.com/google/gofuzz v1.0.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/M65Eg=
|
||||
github.com/json-iterator/go v1.1.12 h1:PV8peI4a0ysnczrg+LtxykD8LfKY9ML6u2jnxaEnrnM=
|
||||
github.com/json-iterator/go v1.1.12/go.mod h1:e30LSqwooZae/UwlEbR2852Gd8hjQvJoHmT4TnhNGBo=
|
||||
github.com/klauspost/cpuid/v2 v2.0.9/go.mod h1:FInQzS24/EEf25PyTYn52gqo7WaD8xa0213Md/qVLRg=
|
||||
github.com/klauspost/cpuid/v2 v2.2.5 h1:0E5MSMDEoAulmXNFquVs//DdoomxaoTY1kUhbc/qbZg=
|
||||
github.com/klauspost/cpuid/v2 v2.2.5/go.mod h1:Lcz8mBdAVJIBVzewtcLocK12l3Y+JytZYpaMropDUws=
|
||||
github.com/knz/go-libedit v1.10.1/go.mod h1:MZTVkCWyz0oBc7JOWP3wNAzd002ZbM/5hgShxwh4x8M=
|
||||
github.com/leodido/go-urn v1.2.4 h1:XlAE/cm/ms7TE/VMVoduSpNBoyc2dOxHs5MZSwAN63Q=
|
||||
github.com/leodido/go-urn v1.2.4/go.mod h1:7ZrI8mTSeBSHl/UaRyKQW1qZeMgak41ANeCNaVckg+4=
|
||||
github.com/mattn/go-isatty v0.0.19 h1:JITubQf0MOLdlGRuRq+jtsDlekdYPia9ZFsB8h/APPA=
|
||||
github.com/mattn/go-isatty v0.0.19/go.mod h1:W+V8PltTTMOvKvAeJH7IuucS94S2C6jfK/D7dTCTo3Y=
|
||||
github.com/modern-go/concurrent v0.0.0-20180228061459-e0a39a4cb421/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd h1:TRLaZ9cD/w8PVh93nsPXa1VrQ6jlwL5oN8l14QlcNfg=
|
||||
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
|
||||
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
|
||||
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
|
||||
github.com/pelletier/go-toml/v2 v2.1.0 h1:FnwAJ4oYMvbT/34k9zzHuZNrhlz48GB3/s6at6/MHO4=
|
||||
github.com/pelletier/go-toml/v2 v2.1.0/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||
github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
|
||||
github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw=
|
||||
github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo=
|
||||
github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
|
||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
||||
github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
||||
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1 h1:SU5vSMR7hnwNxj24w34ZyCi/FmDZTkS4MhqMhdFk5YI=
|
||||
github.com/twitchyliquid64/golang-asm v0.15.1/go.mod h1:a1lVb/DtPvCB8fslRZhAngC2+aY1QWCk3Cedj/Gdt08=
|
||||
github.com/ugorji/go/codec v1.2.11 h1:BMaWp1Bb6fHwEtbplGBGJ498wD+LKlNSl25MjdZY4dU=
|
||||
github.com/ugorji/go/codec v1.2.11/go.mod h1:UNopzCgEMSXjBc6AOMqYvWC1ktqTAfzJZUZgYf6w6lg=
|
||||
golang.org/x/arch v0.0.0-20210923205945-b76863e36670/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
|
||||
golang.org/x/arch v0.5.0 h1:jpGode6huXQxcskEIpOCvrU+tzo81b6+oFLUYXWtH/Y=
|
||||
golang.org/x/arch v0.5.0/go.mod h1:5om86z9Hs0C8fWVUuoMHwpExlXzs5Tkyp9hOrfG7pp8=
|
||||
golang.org/x/crypto v0.12.0 h1:tFM/ta59kqch6LlvYnPa0yx5a83cL2nHflFhYKvv9Yk=
|
||||
golang.org/x/crypto v0.12.0/go.mod h1:NF0Gs7EO5K4qLn+Ylc+fih8BSTeIjAP05siRnAh98yw=
|
||||
golang.org/x/net v0.14.0 h1:BONx9s002vGdD9umnlX1Po8vOZmrgH34qlHcD1MfK14=
|
||||
golang.org/x/net v0.14.0/go.mod h1:PpSgVXXLK0OxS0F31C1/tv6XNguvCrnXIDrFMspZIUI=
|
||||
golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/sys v0.12.0 h1:CM0HF96J0hcLAwsHPJZjfdNzs0gftsLfgKt57wWHJ0o=
|
||||
golang.org/x/sys v0.12.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||
golang.org/x/text v0.13.0 h1:ablQoSUd0tRdKxZewP80B+BaqeKJuVhuRxj/dkrun3k=
|
||||
golang.org/x/text v0.13.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
|
||||
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA=
|
||||
gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||
nullprogram.com/x/optparse v1.0.0/go.mod h1:KdyPE+Igbe0jQUrVfMqDMeJQIJZEuyV7pjYmp6pbG50=
|
||||
rsc.io/pdf v0.1.1/go.mod h1:n8OzWcQ6Sp37PL01nO98y4iUCRdTGarVfzxY20ICaU4=
|
35
notes
Normal file
35
notes
Normal file
@ -0,0 +1,35 @@
|
||||
################## SHOULD I SPLIT FOLLOW INTO 2 TABLES ?? ################################
|
||||
|
||||
we can put following and follower as 1 table instead of 2 table
|
||||
(follower and following) but it's gonna be have multiple where clause when
|
||||
querying instead, we can use less where clause query if we split it into two
|
||||
tables, but idk how big is the performance difference is, so for right now
|
||||
i'm just put it on single table, if the query speed diff noticeable we can
|
||||
just remigrate it later
|
||||
|
||||
REF: - https://www.percona.com/blog/how-expensive-is-a-where-clause-in-mysql/
|
||||
- https://stackoverflow.com/questions/58829268/does-using-where-clause-with-a-select-statement-increase-or-decrease-performance
|
||||
|
||||
|
||||
##########################################################################################
|
||||
|
||||
|
||||
|
||||
######################### IMPLEMENT POLYMORPHIC RELATIONS ################################
|
||||
|
||||
ok idk how to implement polymorphic (without ORM ofc) because Rails have
|
||||
the thing the polymorphic thing but imma just create a table with 1 column
|
||||
"type" just polymorphic relation table so when i query it imma use "where"
|
||||
clause.
|
||||
ex: select message where commented_id = ... and where comment_type = (stories, ratings, locations)
|
||||
|
||||
##########################################################################################
|
||||
|
||||
|
||||
|
||||
####################### INDONESIA ADMINISTRATIVE DIVISION ################################
|
||||
|
||||
https://en.wikipedia.org/wiki/Provinces_of_Indonesia
|
||||
|
||||
|
||||
##########################################################################################
|
3
user_stories
Normal file
3
user_stories
Normal file
@ -0,0 +1,3 @@
|
||||
when user open hiling site, for the firstime frontend or web send an user ip address to server(why ? so they don't have multiple accounts on 1 device, ofc we can limit the thing but i think having 1 account per device is good practice so user not abusing) after that they gonna the page, if they navigate to the homepage they gonna see the index page
|
||||
from there user can click the locations, login, see another user reviews or any other acitivites
|
||||
user can submit user review/rating without login since the system already save user ip address but the user cant see about their reviews, likes, or saved location, user have to login first to see about user reviews, likes, saved location, following etc etc
|
Loading…
Reference in New Issue
Block a user