Bladeren bron

230427-1335-Kim

EricKIm 1 jaar geleden
bovenliggende
commit
255544e921
100 gewijzigde bestanden met toevoegingen van 10238 en 0 verwijderingen
  1. 3 0
      .gitignore
  2. 8 0
      .idea/.gitignore
  3. 17 0
      .idea/erp-kkscrap.iml
  4. 8 0
      .idea/modules.xml
  5. 6 0
      .idea/vcs.xml
  6. 5 0
      .vscode/settings.json
  7. 51 0
      1.reference-manual/configuration.md
  8. 44 0
      1.reference-manual/crypto-erp/crypto-db-tables.md
  9. 22 0
      1.reference-manual/crypto-erp/how-to-add-a-token.md
  10. 53 0
      1.reference-manual/erp-db-tables.md
  11. 27 0
      1.reference-manual/member-regist-process.md
  12. 53 0
      1.reference-manual/pro-db-tables.md
  13. 80 0
      Readme.md
  14. 4 0
      conf-copy/config_select.json
  15. 46 0
      conf-copy/local_config.json
  16. 13 0
      controllers/common-receiver-structs.go
  17. 9 0
      controllers/ctl-common.go
  18. 176 0
      controllers/func/fct-gate-token-and-login-apps copy.go
  19. 106 0
      controllers/join/jct-body-copy.go
  20. 63 0
      controllers/join/jct-chart-pages.go
  21. 29 0
      controllers/join/jct-company-cgroup-page.go
  22. 38 0
      controllers/join/jct-company-search-page.go
  23. 29 0
      controllers/join/jct-item-igroup-page.go
  24. 39 0
      controllers/join/jct-item-search-page.go
  25. 237 0
      controllers/join/jct-list-form-balance.go
  26. 68 0
      controllers/join/jct-list-type1-book.go
  27. 37 0
      controllers/join/jct-list-type1-insert.go
  28. 63 0
      controllers/join/jct-list-type1-page.go
  29. 53 0
      controllers/join/jct-list-type1-upload.go
  30. 39 0
      controllers/join/jct-media-search-page.go
  31. 29 0
      controllers/join/jct-member-menu-perm-page.go
  32. 46 0
      controllers/join/jct-popup-list1-page.go
  33. 59 0
      controllers/join/jct-select-type1-page.go
  34. 36 0
      controllers/join/jct-setting-search-page.go
  35. 151 0
      controllers/join/jct-simple-join-page.go
  36. 43 0
      controllers/join/jct-slip-search-page.go
  37. 67 0
      controllers/join/jct-slip-search-page.go--
  38. 29 0
      controllers/join/jct-user-ext-users.go
  39. 29 0
      controllers/join/jct-user-menu-perm-page.go
  40. 34 0
      controllers/scraper/cafe24/parser.go
  41. 61 0
      controllers/scraper/common/parser_common.go
  42. 17 0
      controllers/scraper/common/parser_common_test.go
  43. 60 0
      controllers/scraper/godo/parser.go
  44. 34 0
      controllers/scraper/magento/parser.go
  45. 34 0
      controllers/scraper/shopify/parser.go
  46. 13 0
      controllers/scraper/shopify/parser_test.go
  47. 245 0
      controllers/scraper/tct-main.go
  48. 46 0
      controllers/scraper/tct_test.go
  49. 63 0
      controllers/scraper/util/util.go
  50. 161 0
      controllers/scraper/wordpress/parser.go
  51. 120 0
      controllers/scraper/wordpress/parser_test.go
  52. 35 0
      controllers/scraper/wordpress/wordpress.go
  53. 46 0
      controllers/scraper/young/parser.go
  54. 105 0
      controllers/table/tct-block.go
  55. 45 0
      go.mod
  56. 258 0
      go.sum
  57. 21 0
      goget.sh
  58. 95 0
      locals/cipher-func.go
  59. 494 0
      locals/common-func-dev.go
  60. 491 0
      locals/common-func-dev.go-
  61. 533 0
      locals/common-func.go
  62. 153 0
      locals/gosodium/cryptobox/crypto_box.go
  63. 72 0
      locals/gosodium/cryptobox/crypto_box_dev.go
  64. 69 0
      locals/gosodium/cryptobox/crypto_box_dev.go-
  65. 138 0
      locals/gosodium/cryptobox/crypto_box_easy.go
  66. 36 0
      locals/gosodium/cryptobox/crypto_box_easy_dev.go
  67. 33 0
      locals/gosodium/cryptobox/crypto_box_easy_dev.go-
  68. 40 0
      locals/gosodium/cryptobox/crypto_box_seal.go
  69. 16 0
      locals/gosodium/cryptobox/crypto_box_seal_dev.go
  70. 13 0
      locals/gosodium/cryptobox/crypto_box_seal_dev.go-
  71. 32 0
      locals/gosodium/support/error.go
  72. 67 0
      locals/gosodium/support/support.go
  73. 94 0
      locals/req.go
  74. 113 0
      locals/structs.go
  75. 71 0
      locals/themes/spider-structs-210523.go
  76. 33 0
      main.go
  77. 62 0
      model/item.go
  78. 17 0
      models/common-triggers.go
  79. 9 0
      models/custom.yml
  80. 28 0
      models/func/fmd-etc-select-name-page.go
  81. 135 0
      models/func/fmd-last-seq-no-get.go
  82. 99 0
      models/func/fmd-login.go
  83. 27 0
      models/func/fmd-sgroup-select.go
  84. 34 0
      models/func/fmd-user-select.go
  85. 179 0
      models/table/function-models-table.go
  86. 3164 0
      models/table/models.go
  87. 0 0
      queries/themes/example
  88. 235 0
      queries/테이블-create-for-syncscan copy.sql
  89. 14 0
      queries/테이블-show-create-for-syncscan.sql
  90. 240 0
      routers/init-a_router-func.go
  91. 5 0
      routers/init-book-and-page.go
  92. 18 0
      routers/init-func.go
  93. 5 0
      routers/init-join.go
  94. 6 0
      routers/init_table/a-tri-init.go
  95. 6 0
      routers/init_themes/a-iri-init.go
  96. 14 0
      runner.conf
  97. 17 0
      runner.conf.README.md
  98. 6 0
      shell/apply-gitignore-after-git-created.sh
  99. 9 0
      shell/dkcu-compose-up.sh
  100. 3 0
      shell/dkrmc-remove-all-containers.sh

+ 3 - 0
.gitignore

@@ -0,0 +1,3 @@
+/vendor
+/conf
+/tmp

+ 8 - 0
.idea/.gitignore

@@ -0,0 +1,8 @@
+# Default ignored files
+/shelf/
+/workspace.xml
+# Editor-based HTTP Client requests
+/httpRequests/
+# Datasource local storage ignored files
+/dataSources/
+/dataSources.local.xml

+ 17 - 0
.idea/erp-kkscrap.iml

@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<module type="WEB_MODULE" version="4">
+  <component name="Go" enabled="true">
+    <buildTags>
+      <option name="customFlags">
+        <array>
+          <option value="dev" />
+        </array>
+      </option>
+    </buildTags>
+  </component>
+  <component name="NewModuleRootManager">
+    <content url="file://$MODULE_DIR$" />
+    <orderEntry type="inheritedJdk" />
+    <orderEntry type="sourceFolder" forTests="false" />
+  </component>
+</module>

+ 8 - 0
.idea/modules.xml

@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="ProjectModuleManager">
+    <modules>
+      <module fileurl="file://$PROJECT_DIR$/.idea/erp-kkscrap.iml" filepath="$PROJECT_DIR$/.idea/erp-kkscrap.iml" />
+    </modules>
+  </component>
+</project>

+ 6 - 0
.idea/vcs.xml

@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project version="4">
+  <component name="VcsDirectoryMappings">
+    <mapping directory="" vcs="Git" />
+  </component>
+</project>

+ 5 - 0
.vscode/settings.json

@@ -0,0 +1,5 @@
+{
+	"files.exclude": {
+		"**/vendor": true
+	}
+}

+ 51 - 0
1.reference-manual/configuration.md

@@ -0,0 +1,51 @@
+# Configuration
+
+## Location : $HOME/conf/
+## config_select.json : Default "ConfSelect": "local",
+
+Note : Take a choice to change to the other conf file for temporary usage
+
+
+## Conf Variable Description.( default filename: local_config.json )
+
+|    Type  |      Name      |  Usage | Deprecated | Remarks |
+|----------|-------------|------|------|------|
+|Kafka|KafkaOn|use Kafea|Yes| |
+| | KafkaTopic | topic name|Yes ||
+| | KafkaAddr | kafka Url |Yes ||
+| | KafkaPort | port number |Yes | |
+| gRpc| gRpcOn| use gRpc| Yes | |
+| | AppName| app name | Yes| |
+| | SiteName| site name | Yes | |
+| | gRpcProtocol| | Yes| |
+| | gRpcAddr| | Yes| |
+| | gRpcPort| | Yes| | |
+|REST API | RestOn| use RESTful | | |
+| |RestConnect | | | |
+| |RestUri| Endpoint including Port No| | |
+| | IsDevMode| Develop Mode| Yes| |
+| | IsSqlDebugMode| | Yes| |
+| | IsNormalDebugMode| | Yes| |
+| | GateTokenSecond| GateToken Validity in second | | |
+| | IsYDBFixed| Development Mode| | YDB is Development Target DB (Fixed) |
+| | YDBConnString| DB connection string  | | |
+| | UDBConnString| |Yes | |
+| | DBOptionString| XORM Option| | Should NOT changed |
+| | XDBOn| | Yes| |
+| | XDBConnString| | Yes| |
+| | IsLocalKeyPair| Disconnect from DaborySSO Server if Yes | | |
+| | LocalKeyPair| KeyPair from libSodium | | Should be prepared if IsLocalKeyPair is "Yes" |
+| | SsoConnString| DaborySSO REST API| | Should be prepared if IsLocalKeyPair is "No" | 
+| | SsoAppBase64| DaborySSO REST API | | Should be prepared if IsLocalKeyPair is "No"| 
+| | DbuConnString| DBUpdate REST API| | |
+| | DbuAppBase64| DBUpdate REST API| | |
+| | DbuByForceOn| DB Update without User confirmation | | Disable Frontend Setting|
+| | IsQryFromQDB| Use Query String Cache in Memory DB | | |
+| | DbuEncryptCode| Unique Key to Retrieve External Private Key| | Supported with  Aes256 (DoNotChange!!)|
+| | SslMode| | | Yes or No|
+| | SslConnect| SSL API connection string including Port No| | |
+| | SslFullChain| location of full chain pem file| | |
+| | SslPrivate| location of private pem file | | |
+| | GethConnString | Geth Web3 API Connection | | |
+| | XrpConnBridge| Ripple Web3 API Connection | | |
+| | DbType| DB type | | Usually "mysql"|

+ 44 - 0
1.reference-manual/crypto-erp/crypto-db-tables.md

@@ -0,0 +1,44 @@
+# DB table list for Cryptocurrency and Blockchain.
+
+##  DB table Category
+
+Note1 : table field description are commented in DB table comment columns.   
+  
+      
+## tables of BCM(Blockchain Member) : To relate between Blockchain and Member
+|     Prefix  |      TableName      |  Description | Generated By|
+|----------|-------------|------|------|
+|bcm|contract|Authentication Check members as Contract owners<br>This is authenticated by Metamask Signature | Contract owners Input |  
+
+       
+## tables of BCS(Blockchain Scanner) 
+## : The most tables are generated by sync-block daemon
+|     Prefix  |      TableName      |  Description | Generated By|
+|----------|-------------|------|------|
+|bcs|contract|Smart Contract Issued| sync-block | 
+|   |circulating|Summerizing for Token Circulation|sync-block | 
+|   |contract_abi  | Application Binary Interface of Smart Contract| Contract owners Input| 
+|   |contract_sol  | Solidity code of Smart Contract |Contract owners Input  | 
+|   |dgn_holder  | summarized token amount by wallet address<br>(What is difference with token_holder ?) | sync-block | 
+|   |last_sync_no | To locate last block# running in sync-block  | sync-block | 
+|   |nft  | we do not use yet |  | 
+|   |token  | Token list and Total balance, decimal(used)  |sync-block  | 
+|   |contract_sol  | Solidity code of Smart Contract |Contract owners Input  | 
+|   |token_add  |Token Info, unit/decimal point(not used)  |Contract owners Input  | 
+|   |token_holder  |summarized token amount by holders  |sync-block  | 
+|   |trans-inter  |internal transactions  |sync-block  | 
+|   |tranxn  |Transaction Record  |sync-block  | 
+|   |txn_transfer  | Not Used |sync-block  | 
+|   |uncle_block  |Uncle Block Record  |sync-block  | 
+|   |unconfirmed  |Unconfirmed Blocks  |sync-block  | 
+
+  
+  
+## tables fof CRP(Crypto Wallet) : used for wallet and payment
+|     Prefix  |      TableName      |  Description | Remarks|
+|----------|-------------|------|------|
+|crp|net_group|Main Net Category| 1 to Many to wallet | 
+|   |token_group  |Each Tokens in Mainnet  |  | 
+|   |wallet  | wallet for each members |  | 
+|   |wallet_token  | interlink between wallet and token_group<br> Because wallets have a Coin and multiple Tokens  |  | 
+

+ 22 - 0
1.reference-manual/crypto-erp/how-to-add-a-token.md

@@ -0,0 +1,22 @@
+# How to add a token in DGC wallet site.
+
+Note1 : this wallet is ripple and DGC wallet combinded so that it in not working on only base
+        of ERC20 protocol. This is why adding a token process is more complicated than "Meta Mask".
+      
+## Step1. db_table : crp_token_group 
+  add a record in the table above : refer descriptions in the DB table comment columns  
+       
+## Step2 : add API source code for added token
+
+## !! How to find the golang API source code location :  
+   1. use search word "DGC" in API source code to find for adding source code. 
+   2. source code locations to add code 
+
+|     File Path  |     Line     |
+|----------|-------------|
+|locals/themes/themes_com-and-func.go |19 |
+| |43 |
+| |113 |
+| |178 |
+| |232 |
+

+ 53 - 0
1.reference-manual/erp-db-tables.md

@@ -0,0 +1,53 @@
+# DB table list
+
+## 프로젝트 initializing 시에 데이터를 초기화해야 될 테이블
+
+## Initializing DB table list
+
+Note1 : In initializing stage, Project leader must truncate tables below:
+
+Note2 : xgroup table means 1 to many category naming convension
+
+Note3 : xxx_taxo means many to many taxonomy naming convension
+
+
+
+## Users table : core table
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|users|ERP User, Admins|#1 Record| | |
+
+.
+## Master table list
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|dbr(ERP)|igroup|Item Group| #1 Record| |
+||cgroup|Company Group| #1 Record| |
+||sgroup|Sales Group| #1 Record| |
+||agroup|Accounting Group| #1 Record| |
+||branch|Branch Office Group| #1 Record| |
+||storage|Storage or Warehouses| #1 Record| |
+
+.
+## Basic(SubMaster) table list
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|dbr(ERP)|item|Goods, Products and Materials| | |
+||company|Buyers, Suppliers and Customers| | |
+
+
+## Composing table list
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|dbr(ERP)|user_menu|ERP, admin menu table| Full Set| |
+||user_perms|ERP, admin menu permission table| | |
+||user_perms_bd|ERP, admin menu permission Body table| | |
+||Buyers, Suppliers and Customers| | |
+
+## System Code table list : should not truncate:
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|dbr(ERP)|deal_type|Deal Type such as Sales, SalesReturn| Full Set| |
+||vat_rate|Vat Rate| | |
+||user_perms_bd|ERP, admin menu permission Body table| | |
+||company|Buyers, Suppliers and Customers| | |

+ 27 - 0
1.reference-manual/member-regist-process.md

@@ -0,0 +1,27 @@
+# 회원/사용자 등록 프로세스
+
+## 관련 setup record : 회원/사용자 등록 기본: setup_code: signup-default  
+Note1 : 위의 setup_code 의 레코드에 등록되어 있는 퍼미션, 각 구분 내용이 회원/사용자 등록시에 기록 된다.
+
+Note2 : xgroup table means 1 to many category naming convension
+
+Note3 : xxx_taxo means many to many taxonomy naming convension
+
+
+
+## Users table : core table
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|users|ERP User, Admins|#1 Record| | |
+
+.
+## Master table list
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|dbr(ERP)|igroup|Item Group| #1 Record| |
+||cgroup|Company Group| #1 Record| |
+||sgroup|Sales Group| #1 Record| |
+||agroup|Accounting Group| #1 Record| |
+||branch|Branch Office Group| #1 Record| |
+||storage|Storage or Warehouses| #1 Record| |
+

+ 53 - 0
1.reference-manual/pro-db-tables.md

@@ -0,0 +1,53 @@
+# DB table list
+
+## 프로젝트 initializing 시에 데이터를 초기화해야 될 테이블
+
+## Initializing DB table list
+
+Note1 : In initializing stage, Project leader must truncate tables below:
+
+Note2 : xgroup table means 1 to many category naming convension
+
+Note3 : xxx_taxo means many to many taxonomy naming convension
+
+
+
+## Users table : core table
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|users|ERP User, Admins|#1 Record| | |
+
+.
+## Master table list
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|dbr(ERP)|igroup|Item Group| #1 Record| |
+||cgroup|Company Group| #1 Record| |
+||sgroup|Sales Group| #1 Record| |
+||agroup|Accounting Group| #1 Record| |
+||branch|Branch Office Group| #1 Record| |
+||storage|Storage or Warehouses| #1 Record| |
+
+.
+## Basic(SubMaster) table list
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|dbr(ERP)|item|Goods, Products and Materials| | |
+||company|Buyers, Suppliers and Customers| | |
+
+
+## Composing table list
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|dbr(ERP)|user_menu|ERP, admin menu table| Full Set| |
+||user_perms|ERP, admin menu permission table| | |
+||user_perms_bd|ERP, admin menu permission Body table| | |
+||Buyers, Suppliers and Customers| | |
+
+## System Code table list : should not truncate:
+|     Prefix-Usage  |      TableName      |  Description | Init Record | Depret |
+|----------|-------------|------|------|------|
+|dbr(ERP)|deal_type|Deal Type such as Sales, SalesReturn| Full Set| |
+||vat_rate|Vat Rate| | |
+||user_perms_bd|ERP, admin menu permission Body table| | |
+||company|Buyers, Suppliers and Customers| | |

+ 80 - 0
Readme.md

@@ -0,0 +1,80 @@
+***!! 주의/중요 . 화일 사이즈와 압축화일 관련 주의사항.***
+
+*** 문서 접근시 404가 뜨는 경우는 로그인이 안된 상태이므로 먼저 로그인을 반드시 해주셔야 됩니다 ***
+
+    문서는 git 서버이므로 화일당 20MB가 넘지 않도록 주의하여 주시고 가급적  압축 화일을 풀어서 올리는 것을 부탁드립니다. 
+
+한개의 화일 크기가 너무 크면 git 서버에서 Raw View 하는 경우 서버가 다운되는 경우가 있습니다.
+
+
+**A. 사용자 등록.** 
+    http://git.daboryhost.com/  로 오셔서 사용자 등록을 부탁드립니다.
+
+    git 서버 관리자가 사용자를 해당 사이트 콜레보레이터로 등록한 후에만  git repository를 사용할 수 있습니다.
+
+    !!! 주의: 사용자 등록 후 반드시 로그인 할 때 자동로그인 되도록 Remember Me 를 Check 해 주세요. 
+
+
+
+**B. git 의 설치**
+
+a. Windows PC의 경우: 
+
+    https://git-scm.com/book/ko/v2/%EC%8B%9C%EC%9E%91%ED%95%98%EA%B8%B0-Git-%EC%84%A4%EC%B9%98
+
+
+**C. git 의 사용 - 커맨드 모드/해당폴더에서**
+
+a. 문서가 있는 폴더에서 
+  
+    \# git clone 현재페이지 URL
+from
+	dbr_sorder
+	inner join dbr_company on dbr_company.id = buyer_id
+	inner join dbr_deal_type on dbr_deal_type.id = deal_type_id
+    예) git clone http://git.daboryhost.com/xxxxxx-docu
+   
+하면 xxxxxx-docu 폴더가 만들어 집니다. 
+
+
+*** git root 폴더(.git folder를 포함하고 있는 폴더)***
+*** 쉘 화일이 긴 것은 앞에 3자 이상 입력하고 탭을 치면 자동 완성이 됩니다. ***
+
+b.  push 하려고 하는 화일을 git의 root 폴더로 복사한 후 해당 폴더로 디렉토리를 옮겨서 (change directory) 
+  
+    \# sh shell/gitpush-you-can-change-name-by-editing-this-file.sh
+   
+    로 실행하시면 git  폴더의 변화가 git server에 반영되면서 변경 내용이 서버에 일괄 업로드됩니다. 
+
+push 하는 사람의 별명을 바꾸고 싶으시면 shell/gitpush-you-can-change-name-by-editing-this-file.sh 화일을 열어 Kim을 원하시는 본인 닉네임으로 바꾸십시요.
+
+
+c. git pull 은 해당 폴더에서 단순히 
+
+    \# sh shell/gitpull-origin-master.sh
+   
+로 하시면 다른 협업자가 변경하거나 추가한 문서 내용이 나의 git 폴더에 반영 됩니다. 
+
+
+d. 일반적으로 내가 수정한 것을 push 하려면 먼저 gitpull을 한 후  gitpush 해야 합니다. 이것을 좀 더 간편하게 하려면 
+  
+    \# sh shell/gitpp-git-push-and-pull-simultaneously.sh
+   
+로 하시면 변화된 내용이 gitpull 과 gitpush가 동시에 수행됩니다. 
+
+
+e. (중요) git 실행시 화일 충돌이 생겨 에러가 나는 경우.(동시에 2명의 작업자가 동일한 화일을 수정한 경우)
+   
+    (1) 화일을 에디터로 열면 충돌난 부분이 <<<<<<<<< 수정 부분 >>>>>>>>> 이렇게 표시됩니다. 
+    (2) 해당 충돌 부분에 대해 원하시는 형태로 수정한 후 (d. gitpp) 로 동기화 하십시요.
+이후의 에러의 경우 알려주시면 조치해드리겠습니다.
+
+f. gitpush 와 gitpull 은 복잡한 git 명령어를 일반인들이 간단하게 사용할 수 있도록 만든 shell script이며 에디터로 내용을 변경하거나 수정하여 사용할 수 있습니다.
+
+g. gitpush 나 gitpp 시 [git] fatal : unable to auto-detect email 관련 오류 해결방법
+
+    \# git config --global user.email "깃서버email"
+
+    \# git config --global user.name "깃서버ID"
+
+이 문제는 git의 login email을 Local PC에 저장하여 즉시 git 의 동기화를 할 수 있도록 합니다.

+ 4 - 0
conf-copy/config_select.json

@@ -0,0 +1,4 @@
+{
+    "ConfSelect": "local",
+    "ConfPostFix": "_config.json"
+}

+ 46 - 0
conf-copy/local_config.json

@@ -0,0 +1,46 @@
+[
+
+	{ "Key": "RestOn", "Value": "Yes" },
+	{ "Key": "RestConnect", "Value": ":19080" },
+	{ "Key": "RestUri", "Value": "/" },
+
+	{ "Key": "IsYDBFixed", "Value": "Yes" },
+	{ "Key": "YDBConnString", "Value": "weberp_db:nb7X94raSds@tcp(13.124.2.254:3306)/weberp_db" },
+	{ "Key": "UDBConnString", "Value": "" },
+	{ "Key": "DBOptionString", "Value": "?charset=utf8&multiStatements=true&autocommit=true" },
+
+	{ "Key": "XDBOn", "Value": "Yes" },
+	{ "Key": "XDBConnString", "Value": "" },
+
+	{ "Key": "IsLocalKeyPair", "Value": "No" },
+	{ "Key": "LocalKeyPair", "Value": "" },
+
+	{ "Key": "SsoConnString", "Value": "https://daborysso.com/dabory-app" },
+	{ "Key": "SsoAppBase64", "Value": "8NySSC/Jdi5KHOPXni35p+2a7EhPu03f6V3cAaiotB4o1FEJ0B2sDjzg5uBOdF3VBLkj1URRADotBpOAda5MZyV6Xnr/5DWo7rHEVMFvapg=" },
+
+	{ "Key": "DbuConnString", "Value": "http://dbupdate-season2204.dabory.com/dabory-app" },
+	{ "Key": "DbuAppBase64", "Value": "pAfnoZn0AKT5lbWHQAYkvYh/Tks10Znsna78VatuxSSRv/zU4MmjjpKVXe6bRHbrkEwyZAB2ylJs2NaERSb/0+qL5C3ovlw1X/rIa5mSGbU=" },
+	{ "Key": "DbuByForceOn", "Value": "No" },
+
+	{ "Key": "IsQryFromQDB", "Value": "No" },
+	
+	{ "Key": "DbuEncryptCode", "Value": "kimhi65@gmail.com" },
+
+	{ "Key": "SslMode", "Value": "No" },
+	{ "Key": "SslConnect", "Value": ":40443" },
+	{ "Key": "SslFullChain", "Value": "/etc/letsencrypt/live/api.dabory.com/fullchain.pem" },
+	{ "Key": "SslPrivate", "Value": "/etc/letsencrypt/live/api.dabory.com/privkey.pem" },
+	
+	{ "Key": "//SyncScanConf-Starts-From-Here//", "Value": "" },
+	{ "Key": "MainNetName", "Value": "etherium" },
+	{ "Key": "IsCronJob", "Value": "Yes" },
+	{ "Key": "CronJobInterval", "Value": "@every 10s" },
+	{ "Key": "GethConnString", "Value": "http://3.38.62.211:8545" },
+
+	{ "Key": "SyncClientId", "Value": "d9YSWV1-8YkI6H5bKV" },
+	{ "Key": "SyncBB64", "Value": "ksBI9B2xaA8EDzTlFx8Cc8bGD2jgQwWl1X85qEGh9HYQqMk+RsC0f5pPIiDxmedaco8PGCL+xgW5oFq2sGKiUL6lL236twH9Bxz6v+Mc/V+xiqAOG7Dq0/9ziYF0ddXeE/w2JCZUeRVo/ZVPOAjRGGRFRhIUSVH5wojh6E/fbV3n32cnnv4NsOYAj0QDd+M1xsMZwD49ME9PLnPgIcRlneY+wRF+/L3axYDUGpbAQrkW/Q==" },
+	{ "Key": "SyncKeyPair", "Value": "" },
+
+	{ "Key": "DbType", "Value": "mysql" }
+
+]

+ 13 - 0
controllers/common-receiver-structs.go

@@ -0,0 +1,13 @@
+package controllers
+
+// type CommonPageReq struct {
+// 	PageVars locals.PageVars
+// }
+
+type SlipId struct {
+	SlipId int
+}
+
+type SlipIdPageReq struct {
+	Page []SlipId
+}

+ 9 - 0
controllers/ctl-common.go

@@ -0,0 +1,9 @@
+package controllers
+
+import (
+	"github.com/dabory/abango-rest"
+)
+
+type Abango struct {
+	abango.Controller
+}

+ 176 - 0
controllers/func/fct-gate-token-and-login-apps copy.go

@@ -0,0 +1,176 @@
+package controllers_func
+
+import (
+	"encoding/base64"
+	"encoding/json"
+	"fmt"
+	"kkscrap-go/locals"
+	cryptobox "kkscrap-go/locals/gosodium/cryptobox"
+	"net/http"
+	"strconv"
+	"strings"
+
+	// "golang.org/x/crypto/bcrypt"
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+	"github.com/labstack/echo"
+)
+
+type GateTokenGetReq struct {
+	ClientId     string
+	BeforeBase64 string
+	AppBase64    string
+}
+
+func GateTokenGet(c echo.Context) error {
+
+	v := c.Get("receiver").(GateTokenGetReq)
+
+	var kPairStr string
+	if abango.XConfig["IsLocalKeyPair"] != "Yes" {
+		keypair, err := locals.GuestKeyPairGet(v.ClientId)
+		if err != nil {
+			return c.String(505, e.LogStr("23443rw0dkwk", "Remote KeyPair Failure "+err.Error()))
+		}
+		kPairStr = keypair
+		// fmt.Println("RemoteKeypair:", kPairStr)
+
+	} else {
+		// kPairStr = abango.XConfig["LocalKeyPair"]
+		fmt.Println("LocalKeyPair:", kPairStr)
+	}
+
+	keyPair, err := base64.StdEncoding.DecodeString(kPairStr)
+	if err != nil {
+		return c.String(505, e.LogStr("ertjhdssfwew", "Decryption Failure-1 "+err.Error()))
+	}
+
+	// locals.ShowDebug("", "Success: KeyPair base64 Decoding")
+	// locals.ShowDebug("", "If runtime error: invalid memory address or nil pointer dereference After this")
+	sKey, pKey, err := cryptobox.CryptoBoxGetSecretPublicKeyFrom(keyPair)
+	if err != nil {
+		return c.String(505, e.LogStr("56432d5vd", "Decryption Failure-2:  "+err.Error()))
+	}
+
+	var decClientId string
+	var ssoSubId int
+	if v.AppBase64 != "" {
+		decodedStr, err := base64.StdEncoding.DecodeString(v.AppBase64)
+		if err != nil {
+			return c.String(505, e.LogStr("2l3krhjo21", "AppBase64 Decryption Failure-App1:  "+err.Error()))
+		}
+
+		decryptedBytes, boxRet := cryptobox.CryptoBoxSealOpen(decodedStr, pKey, sKey)
+		if boxRet != 0 {
+			return c.String(505, e.LogStr("65afdfaefad", "AppBase64 Decryption Failure-App2, boxRet: "+strconv.Itoa(boxRet)))
+		}
+		// fmt.Println("ccc")
+		// fmt.Println("decryptedBytes(clientid):", string(decryptedBytes))
+		tmpcid := strings.Replace(string(decryptedBytes), "\"", "", -1)
+
+		fmt.Println("clientid:", string(tmpcid))
+		if !strings.Contains(tmpcid, ":") {
+			decClientId = tmpcid
+		} else {
+			split := strings.Split(tmpcid, ":")
+			if len(split) > 2 {
+				return c.String(505, e.LogStr("123p9yhsdoeu", "Too many ':' separators : "+err.Error()))
+			}
+			decClientId = split[0]
+			i, err := strconv.Atoi(split[1])
+			if err != nil {
+				return c.String(505, e.LogStr("01yhvhd932ur", "SsoSubId is not integer:  "+err.Error()))
+			}
+			ssoSubId = i
+		}
+
+		fmt.Println("ssoSubId:", ssoSubId)
+		if v.ClientId != decClientId {
+			return c.String(505, e.LogStr("35dswrjuq3d", "AppBase64 ClientId mismatch Failure-App3: "+err.Error()))
+		}
+	}
+
+	// fmt.Println("v.BeforeBase64", v.BeforeBase64)
+	decodedBytes, err := base64.StdEncoding.DecodeString(v.BeforeBase64)
+	if err != nil {
+		return c.String(505, e.LogStr("4556fdeq3", "Decryption Failure-3:  "+err.Error()))
+	}
+
+	//decrypt 문제는 여기서 memory error 가 난다.
+	decryptedBytes, boxRet := cryptobox.CryptoBoxSealOpen(decodedBytes, pKey, sKey)
+	if boxRet != 0 {
+		return c.String(505, e.LogStr("bvsgrere", "Decryption Failure-4(Wrong BB64Key): boxRet:"+strconv.Itoa(boxRet)))
+	}
+
+	vmc := &struct {
+		Driver   string
+		Host     string
+		Port     int
+		Username string
+		Database string
+		Password string
+	}{}
+
+	if err := json.Unmarshal(decryptedBytes, vmc); err != nil {
+		return c.String(505, e.LogStr("2234sdfafae", "Decryption Failure-5: "+err.Error()))
+	}
+
+	gtb := &struct {
+		abango.GateTokenBase
+	}{}
+
+	gtb.ConnString = vmc.Username + ":" + vmc.Password + "@tcp(" + vmc.Host + ":" + e.NumToStr(vmc.Port) + ")/" + vmc.Database
+
+	gtb.ConnString += abango.XConfig["DBOptionString"]
+	gtb.SsoSubId = ssoSubId
+
+	gtb.RemoteIp = c.Request().Header.Get("RemoteIp")
+	gtb.FrontIp = c.RealIP()
+	gtb.FrontHost = c.Request().Header.Get("FrontendHost")
+	gtb.Referer = c.Request().Header.Get("Referer")
+
+	gtBytes, _ := json.Marshal(gtb)
+
+	// fmt.Println("ConnString:", gtb.ConnString)
+	// fmt.Println("gtBytes:", string(gtBytes))
+	gateToken := e.RandString(20)
+	// fmt.Println("decryptedString:", string(gtBytes))
+	if err := abango.MdbUpdate(gateToken, string(gtBytes)); err != nil {
+		return c.String(505, "werqwrqwerqwr-MdbUpdate failed: "+err.Error())
+	}
+
+	retv := &struct {
+		GateToken string
+	}{
+		GateToken: gateToken,
+	}
+
+	ret, _ := json.Marshal(retv)
+	return c.JSONBlob(http.StatusOK, ret)
+}
+
+type GateTokenTestReq struct {
+	//Function Call Format을 맞추어 주기 위해서
+}
+
+func GateTokenTest(c echo.Context) error {
+
+	// if abango.XConfig["IsDevMode"] != "Yes" {
+	// 	return c.String(709, "dflajdffdle@/gate-token-test is Only supported in Development Mode !! ")
+	// }
+	retv := &struct {
+		abango.GateTokenBase
+	}{}
+
+	if gtbStr, err := abango.MdbView(c.Request().Header.Get("GateToken")); err == nil {
+		if err := json.Unmarshal([]byte(gtbStr), retv); err != nil {
+			return c.String(700, "323r3f2efd-AfterBase64-Content Format mismatch: "+err.Error())
+		}
+	} else {
+		return c.String(604, "ertvwerawqfd-MdbView failed: "+err.Error())
+	}
+
+	// retv.ConnString = "" //보안을 위해서 막음.
+	ret, _ := json.Marshal(retv)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 106 - 0
controllers/join/jct-body-copy.go

@@ -0,0 +1,106 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	controllers_func "kkscrap-go/controllers/func"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type BodyCopyPageReq struct {
+	QueryVars        locals.QueryVars
+	BodyCopyPageVars locals.BodyCopyPageVars
+	PageVars         locals.PageVars
+}
+
+func BodyCopyPage(c echo.Context) error {
+
+	v := c.Get("receiver").(BodyCopyPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.BodyCopyPageRet
+	}{}
+
+	vRet.QueryVars = v.QueryVars
+	vRet.BodyCopyPageVars = v.BodyCopyPageVars
+	vRet.PageVars = v.PageVars
+	if err := vRet.GetBodyCopyPage(&y); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}
+
+type BodyCopyMactReq struct {
+	QueryVars     locals.QueryVars
+	LastSeqNoVars controllers_func.LastSeqNoGetReq
+	Page          []locals.BodyCopyBase
+}
+
+func BodyCopyMact(c echo.Context) error {
+
+	v := c.Get("receiver").(BodyCopyMactReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.BodyCopyMactRet
+	}{}
+
+	// var msg string
+	// var accErr error
+
+	q := &v.QueryVars
+	sn := &v.LastSeqNoVars
+
+	// if if v.q{
+	// 	return c.String(608, "Transaction Commit Failed")
+	// }
+
+	vIdRet := &locals.IdBase{}
+	sess := y.Db.NewSession()
+	defer sess.Close()
+	if err := sess.Begin(); err == nil {
+		for _, row := range v.Page {
+
+			seqNo := 0
+			if serial, err := controllers_func.LastSerial(&y, sn.TableName+sn.SlipNo); err == nil {
+				seqNo = serial
+			} else {
+				return c.String(605, err.Error())
+			}
+
+			if addId, err := models_join.BodyCopyAdd(&y, q.QueryName, sn.TableName, sn.SlipNo, seqNo, row.BdId, row.Qty); err == nil {
+				vIdRet.Id = addId
+				vRet.Page = append(vRet.Page, *vIdRet)
+			} else {
+				sess.Rollback()
+				return c.String(603, err.Error())
+			}
+
+			// if addId, err := models_join.BodyCopyAdd(&y, q.QueryName, v.SlipId, seqNo, row.BdId, row.Qty); err == nil {
+			// 	vIdRet.Id = addId
+			// 	vRet.Page = append(vRet.Page, *vIdRet)
+			// } else {
+			// 	sess.Rollback()
+			// 	return c.String(603, err.Error())
+			// }
+
+		}
+	} else {
+		return c.String(608, "Transaction Action Failed")
+	}
+
+	if err := sess.Commit(); err != nil {
+		return c.String(608, "Transaction Commit Failed")
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+
+}

+ 63 - 0
controllers/join/jct-chart-pages.go

@@ -0,0 +1,63 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type ChartLine2PageReq struct {
+	QueryVars      locals.QueryVars
+	ChartLine2Vars locals.ListType1Vars
+	PageVars       locals.PageVars
+}
+
+type ChartType1PageReq struct {
+	QueryVars      locals.QueryVars
+	ChartLine2Vars locals.ListType1Vars
+	PageVars       locals.PageVars
+}
+
+func ChartLine2Page(c echo.Context) error {
+
+	v := c.Get("receiver").(ChartLine2PageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.ChartLine2PageRet
+	}{}
+
+	vRet.QueryVars = v.QueryVars
+	vRet.ChartLine2Vars = v.ChartLine2Vars
+
+	if err := vRet.GetChartLine2Page(&y); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}
+
+func ChartType1Page(c echo.Context) error {
+
+	v := c.Get("receiver").(ChartType1PageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.ChartType1PageRet
+	}{}
+
+	vRet.QueryVars = v.QueryVars
+	vRet.ChartLine2Vars = v.ChartLine2Vars
+
+	if err := vRet.GetChartType1Page(&y); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 29 - 0
controllers/join/jct-company-cgroup-page.go

@@ -0,0 +1,29 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/controllers"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+func CompanyCgroupPage(c echo.Context) error {
+
+	v := c.Get("receiver").(controllers.CommonPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.CompanyCgroupPageRet
+	}{}
+
+	vRet.PageVars = v.PageVars
+	if msg, err := vRet.GetCompanyCgroupPage(y.Db); err != nil {
+		return c.String(607, msg)
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 38 - 0
controllers/join/jct-company-search-page.go

@@ -0,0 +1,38 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type CompanySearchPageReq struct {
+	QueryVars         locals.QueryVars
+	CompanySearchVars locals.CompanySearchVars
+	PageVars          locals.PageVars
+}
+
+func CompanySearchPage(c echo.Context) error {
+
+	v := c.Get("receiver").(CompanySearchPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.CompanySearchPageRet
+	}{}
+
+	vRet.QueryVars = v.QueryVars
+	vRet.CompanySearchVars = v.CompanySearchVars
+	vRet.PageVars = v.PageVars
+
+	if err := vRet.GetCompanySearchPage(y.Db); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 29 - 0
controllers/join/jct-item-igroup-page.go

@@ -0,0 +1,29 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/controllers"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+func ItemIgroupPage(c echo.Context) error {
+
+	v := c.Get("receiver").(controllers.CommonPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.ItemIgroupPageRet
+	}{}
+
+	vRet.PageVars = v.PageVars
+	if err := vRet.GetItemIgroupPage(y.Db); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 39 - 0
controllers/join/jct-item-search-page.go

@@ -0,0 +1,39 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type ItemSearchPageReq struct {
+	QueryVars      locals.QueryVars
+	ItemSearchVars locals.ItemSearchVars
+	PageVars       locals.PageVars
+}
+
+func ItemSearchPage(c echo.Context) error {
+
+	v := c.Get("receiver").(ItemSearchPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.ItemSearchPageRet
+	}{}
+
+	vRet.QueryVars = v.QueryVars
+	vRet.ItemSearchVars = v.ItemSearchVars
+	vRet.PageVars = v.PageVars
+	// fmt.Println(vRet)
+
+	if err := vRet.GetItemSearchPage(y.Db); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 237 - 0
controllers/join/jct-list-form-balance.go

@@ -0,0 +1,237 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"errors"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	models_table "kkscrap-go/models/table"
+	"net/http"
+	"strconv"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type BalanceIdPageBase struct {
+	Page []locals.IdBase
+}
+
+type ListFormBalancePageReq struct {
+	QueryVars           locals.QueryVars
+	ListFormBalanceVars locals.ListFormBalanceVars
+	PageVars            locals.PageVars
+}
+
+func ListFormBalancePage(c echo.Context) error {
+
+	v := c.Get("receiver").(ListFormBalancePageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.ListFormBalancePageRet
+	}{}
+
+	vRet.QueryVars = v.QueryVars
+	vRet.ListFormBalanceVars = v.ListFormBalanceVars
+	vRet.PageVars = v.PageVars
+
+	if err := vRet.GetListFormBalancePage(&y); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}
+
+type ListFormBalanceMactReq struct {
+	QueryVars           locals.QueryVars
+	ListFormBalanceVars locals.ListFormBalanceVars
+	Page                []models_join.ListFormBalance
+}
+
+func ListFormBalanceMact(c echo.Context) error {
+
+	v := c.Get("receiver").(ListFormBalanceMactReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		BalanceIdPageBase
+	}{}
+
+	if v.QueryVars.QueryName == "item" {
+		if status, err := vRet.ListFormBalanceMactItem(y, v); err != nil {
+			return c.String(status, err.Error())
+		}
+	} else if v.QueryVars.QueryName == "supplier" {
+		if status, err := vRet.ListFormBalanceMactSupplier(y, v); err != nil {
+			return c.String(status, err.Error())
+		}
+	} else if v.QueryVars.QueryName == "buyer" {
+		if status, err := vRet.ListFormBalanceMactBuyer(y, v); err != nil {
+			return c.String(status, err.Error())
+		}
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}
+
+func (vRet *BalanceIdPageBase) ListFormBalanceMactBuyer(y abango.Controller, v ListFormBalanceMactReq) (int, error) {
+
+	vIdRet := &locals.IdBase{}
+
+	t := &struct {
+		models_table.DbrBalBuyer
+	}{}
+
+	sess := y.Db.NewSession()
+	defer sess.Close()
+	if err := sess.Begin(); err == nil {
+		for _, row := range v.Page {
+
+			if !(row.Id < 0) {
+				t.BranchId = y.Gtb.BranchId
+			}
+
+			t.YyyyMm = v.ListFormBalanceVars.YyyyMm
+
+			t.Id = row.Id
+			t.BuyerId = row.CodeId
+			t.BalAmt = row.Balance2 //맨마지막 밸렌스 이용
+
+			skipRow := false // Do NOT write row if Balaces are ZERO
+			if bal, err := strconv.ParseFloat(row.Balance2, 32); err == nil {
+				if bal == 0 {
+					skipRow = true
+				}
+			}
+			if t.Id == 0 && !skipRow {
+				if err := t.AddaRow(&y); err != nil {
+					sess.Rollback()
+					return 603, err
+				}
+			} else if t.Id > 0 {
+				if err := t.EditaRow(&y); err != nil {
+					sess.Rollback()
+					return 605, err
+				}
+			}
+			vIdRet.Id = t.Id
+			vRet.Page = append(vRet.Page, *vIdRet)
+		}
+	} else {
+		return 608, errors.New("Transaction Action Failed")
+	}
+
+	if err := sess.Commit(); err != nil {
+		return 608, errors.New("Transaction Commit Failed")
+	}
+	return 200, nil
+}
+
+func (vRet *BalanceIdPageBase) ListFormBalanceMactSupplier(y abango.Controller, v ListFormBalanceMactReq) (int, error) {
+
+	vIdRet := &locals.IdBase{}
+
+	t := &struct {
+		models_table.DbrBalSupplier
+	}{}
+
+	sess := y.Db.NewSession()
+	defer sess.Close()
+	if err := sess.Begin(); err == nil {
+		for _, row := range v.Page {
+
+			if !(row.Id < 0) {
+				t.BranchId = y.Gtb.BranchId
+			}
+
+			t.YyyyMm = v.ListFormBalanceVars.YyyyMm
+
+			t.Id = row.Id
+			t.SupplierId = row.CodeId
+			t.BalAmt = row.Balance2 //맨마지막 밸렌스 이용
+
+			skipRow := false // Do NOT write row if Balaces are ZERO
+			if bal, err := strconv.ParseFloat(row.Balance2, 32); err == nil {
+				if bal == 0 {
+					skipRow = true
+				}
+			}
+			if t.Id == 0 && !skipRow {
+				if err := t.AddaRow(&y); err != nil {
+					sess.Rollback()
+					return 603, err
+				}
+			} else if t.Id > 0 {
+				if err := t.EditaRow(&y); err != nil {
+					sess.Rollback()
+					return 605, err
+				}
+			}
+			vIdRet.Id = t.Id
+			vRet.Page = append(vRet.Page, *vIdRet)
+		}
+	} else {
+		return 608, errors.New("Transaction Action Failed")
+	}
+
+	if err := sess.Commit(); err != nil {
+		return 608, errors.New("Transaction Commit Failed")
+	}
+	return 200, nil
+}
+
+func (vRet *BalanceIdPageBase) ListFormBalanceMactItem(y abango.Controller, v ListFormBalanceMactReq) (int, error) {
+
+	vIdRet := &locals.IdBase{}
+
+	t := &struct {
+		models_table.DbrBalItem
+	}{}
+
+	sess := y.Db.NewSession()
+	defer sess.Close()
+	if err := sess.Begin(); err == nil {
+		for _, row := range v.Page {
+
+			t.YyyyMm = v.ListFormBalanceVars.YyyyMm
+			t.StorageId = v.ListFormBalanceVars.SelectedId
+
+			t.Id = row.Id
+			t.ItemId = row.CodeId
+			t.BalQty = row.Balance
+			t.BadBalQty = row.Balance2
+
+			skipRow := false // Do NOT write row if Balaces are ZERO
+			if bal, err := strconv.ParseFloat(row.Balance, 32); err == nil {
+				if bal2, err := strconv.ParseFloat(row.Balance2, 32); err == nil {
+					if bal == 0 && bal2 == 0 {
+						skipRow = true
+					}
+				}
+			}
+			if t.Id == 0 && !skipRow {
+				if err := t.AddaRow(&y); err != nil {
+					sess.Rollback()
+					return 603, err
+				}
+			} else if t.Id > 0 {
+				if err := t.EditaRow(&y); err != nil {
+					sess.Rollback()
+					return 605, err
+				}
+			}
+			vIdRet.Id = t.Id
+			vRet.Page = append(vRet.Page, *vIdRet)
+		}
+	} else {
+		return 608, errors.New("Transaction Action Failed")
+	}
+
+	if err := sess.Commit(); err != nil {
+		return 608, errors.New("Transaction Commit Failed")
+	}
+	return 200, nil
+}

+ 68 - 0
controllers/join/jct-list-type1-book.go

@@ -0,0 +1,68 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"fmt"
+	controllers_func "kkscrap-go/controllers/func"
+	models_join "kkscrap-go/models/join"
+	models_table "kkscrap-go/models/table"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type ListType1BookReq struct {
+	Book []ListType1PageReq
+}
+
+func ListType1Book(c echo.Context) error {
+
+	v := c.Get("receiver").(ListType1BookReq)
+	y := c.Get("abango").(abango.Controller)
+	fmt.Println(len(v.Book))
+
+	vRet := &models_join.ListType1BookRet{}
+	vPgRet := &models_join.ListType1PageRet{}
+	vEmptyPage := &struct {
+		Page []models_table.DbtListType1
+	}{}
+
+	for _, row := range v.Book {
+
+		vPgRet.QueryVars = row.QueryVars
+		vPgRet.SetupVars = row.SetupVars
+		vPgRet.ListType1Vars = row.ListType1Vars
+		vPgRet.PageVars = row.PageVars
+		vPgRet.Page = vEmptyPage.Page
+
+		r := c.Request().URL.Path
+		sqlDir := ""
+		if r == "/list-type1-book" {
+			sqlDir = "list"
+		} else if r == "/search-type1-book" { //이건 뭐지 ?
+			sqlDir = "search"
+		}
+
+		if vPgRet.ListType1Vars.IsDownloadList == false {
+			if err := vPgRet.GetListType1PagePlain(&y, sqlDir); err != nil {
+				return c.String(607, err.Error())
+			}
+		} else if vPgRet.ListType1Vars.IsDownloadList == true {
+			if err := vPgRet.GetListType1PageTmp(&y, sqlDir); err != nil {
+				return c.String(607, err.Error())
+			}
+		}
+
+		if len(vPgRet.SetupVars) != 0 {
+			if err := controllers_func.SetupJsonArrayGet(&y, vPgRet); err != nil {
+				return c.String(607, err.Error())
+			}
+		}
+
+		vRet.Book = append(vRet.Book, *vPgRet)
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 37 - 0
controllers/join/jct-list-type1-insert.go

@@ -0,0 +1,37 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type ListType1InsertReq struct {
+	InsertVars locals.InsertVars
+}
+
+func ListType1Insert(c echo.Context) error {
+
+	v := c.Get("receiver").(ListType1InsertReq)
+	y := c.Get("abango").(abango.Controller)
+
+	var vRet models_join.ListTypeInsertRet
+
+	var cnt int
+	var err error
+
+	vRet.InsertVars = v.InsertVars
+
+	if cnt, err = vRet.Lt1Insert(&y); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	vRet.InsertCnt = cnt
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 63 - 0
controllers/join/jct-list-type1-page.go

@@ -0,0 +1,63 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	controllers_func "kkscrap-go/controllers/func"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type ListType1PageReq struct {
+	QueryVars     locals.QueryVars
+	SetupVars     []locals.SetupBase
+	ListType1Vars locals.ListType1Vars
+	PageVars      locals.PageVars
+}
+
+func ListType1Page(c echo.Context) error {
+
+	v := c.Get("receiver").(ListType1PageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	// vRet := &struct {
+	// 	models_join.ListType1PageRet
+	// }{}
+
+	var vRet models_join.ListType1PageRet
+
+	vRet.QueryVars = v.QueryVars
+	vRet.SetupVars = v.SetupVars
+	vRet.ListType1Vars = v.ListType1Vars
+	vRet.PageVars = v.PageVars
+
+	r := c.Request().URL.Path
+	sqlDir := ""
+	if r == "/list-type1-page" {
+		sqlDir = "list"
+	} else if r == "/search-type1-page" {
+		sqlDir = "search"
+	}
+
+	if v.ListType1Vars.IsDownloadList == false {
+		if err := vRet.GetListType1PagePlain(&y, sqlDir); err != nil {
+			return c.String(607, err.Error())
+		}
+	} else if v.ListType1Vars.IsDownloadList == true {
+		if err := vRet.GetListType1PageTmp(&y, sqlDir); err != nil {
+			return c.String(607, err.Error())
+		}
+	}
+
+	if len(vRet.SetupVars) != 0 {
+		if err := controllers_func.SetupJsonArrayGet(&y, &vRet); err != nil {
+			return c.String(607, err.Error())
+		}
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 53 - 0
controllers/join/jct-list-type1-upload.go

@@ -0,0 +1,53 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	models_table "kkscrap-go/models/table"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+	"github.com/labstack/echo"
+)
+
+type ListType1UploadReq struct {
+	// Page          []models_table.DbtUploadType1
+	Page []models_table.DbtListType1
+}
+
+func ListType1Upload(c echo.Context) error {
+
+	v := c.Get("receiver").(ListType1UploadReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		ListToken string
+	}{}
+
+	sess := y.Db.NewSession()
+	defer sess.Close()
+
+	// tmpTable := "dbt_upload_type1"
+	// y.Db.Exec("delete from " + tmpTable + " where created_on > 0")
+	listToken := e.RandString(10)
+	if err := sess.Begin(); err == nil {
+		for _, row := range v.Page {
+			row.Id = 0
+			row.ListToken = listToken
+			if err := row.AddaRow(&y); err != nil {
+				sess.Rollback()
+				return c.String(603, err.Error())
+			}
+		}
+	} else {
+		return c.String(608, "Transaction Action Failed")
+	}
+
+	if err := sess.Commit(); err != nil {
+		return c.String(608, "Transaction Commit Failed")
+	}
+
+	vRet.ListToken = listToken
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 39 - 0
controllers/join/jct-media-search-page.go

@@ -0,0 +1,39 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type MediaSearchPageReq struct {
+	QueryVars       locals.QueryVars
+	MediaSearchVars locals.MediaSearchVars
+	PageVars        locals.PageVars
+}
+
+func MediaSearchPage(c echo.Context) error {
+
+	v := c.Get("receiver").(MediaSearchPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.MediaSearchPageRet
+	}{}
+
+	vRet.QueryVars = v.QueryVars
+	vRet.MediaSearchVars = v.MediaSearchVars
+	vRet.PageVars = v.PageVars
+	// fmt.Println(vRet)
+
+	if err := vRet.GetMediaSearchPage(y.Db); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 29 - 0
controllers/join/jct-member-menu-perm-page.go

@@ -0,0 +1,29 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/controllers"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+func MemberMenuPermPage(c echo.Context) error {
+
+	v := c.Get("receiver").(controllers.CommonPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.MemberMenuPermPageRet
+	}{}
+
+	vRet.PageVars = v.PageVars
+	if msg, err := vRet.GetMemberMenuPermPage(y.Db); err != nil {
+		return c.String(607, msg)
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 46 - 0
controllers/join/jct-popup-list1-page.go

@@ -0,0 +1,46 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type PopupList1PageReq struct {
+	QueryVars      locals.QueryVars
+	PopupList1Vars locals.PopupList1Vars
+	ListType1Vars  locals.ListType1Vars
+	PageVars       locals.PageVars
+}
+
+func PopupList1Page(c echo.Context) error {
+
+	v := c.Get("receiver").(PopupList1PageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.PopupList1PageRet
+	}{}
+
+	vRet.QueryVars = v.QueryVars
+	vRet.ListType1Vars = v.ListType1Vars
+	vRet.PopupList1Vars = v.PopupList1Vars
+	vRet.PageVars = v.PageVars
+
+	if v.ListType1Vars.IsDownloadList == false {
+		if err := vRet.GetPopupList1PagePlain(&y); err != nil {
+			return c.String(607, err.Error())
+		}
+	} else if v.ListType1Vars.IsDownloadList == true {
+		if err := vRet.GetPopupList1PageTmp(&y); err != nil {
+			return c.String(607, err.Error())
+		}
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 59 - 0
controllers/join/jct-select-type1-page.go

@@ -0,0 +1,59 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type SelectType1PageReq struct {
+	QueryVars locals.QueryVars
+	// SetupVars       []locals.SetupBase
+	SelectType1Vars locals.SelectType1Vars
+	PageVars        locals.PageVars
+}
+
+func SelectType1Page(c echo.Context) error {
+
+	v := c.Get("receiver").(SelectType1PageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.SelectType1PageRet
+	}{}
+
+	// fmt.Println(v)
+	// var vRet models_join.SelectType1PageRet
+
+	vRet.QueryVars = v.QueryVars
+	// vRet.SetupVars = v.SetupVars
+	vRet.SelectType1Vars = v.SelectType1Vars
+	vRet.PageVars = v.PageVars
+
+	// r := c.Request().URL.Path
+	sqlDir := "select"
+
+	//당분간 아래 지우지 말것
+	// if v.SelectType1Vars.IsDownloadList == false {
+	// 	if err := vRet.GetSelectType1PagePlain(&y, sqlDir); err != nil {
+	// 		return c.String(607, err.Error())
+	// 	}
+	// } else if v.SelectType1Vars.IsDownloadList == true {
+	if err := vRet.GetSelectType1PageTmp(&y, sqlDir); err != nil {
+		return c.String(607, err.Error())
+	}
+	// }
+
+	// if len(vRet.SetupVars) != 0 {
+	// 	if err := controllers_func.SetupJsonArrayGet(&y, &vRet); err != nil {
+	// 		return c.String(607, err.Error())
+	// 	}
+	// }
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 36 - 0
controllers/join/jct-setting-search-page.go

@@ -0,0 +1,36 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type SettingSearchPageReq struct {
+	QueryVars locals.QueryVars
+	PageVars  locals.PageVars
+}
+
+func SettingSearchPage(c echo.Context) error {
+
+	v := c.Get("receiver").(SettingSearchPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.SettingSearchPageRet
+	}{}
+
+	vRet.QueryVars = v.QueryVars
+	vRet.PageVars = v.PageVars
+
+	if err := vRet.GetSettingSearchPage(y.Db); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 151 - 0
controllers/join/jct-simple-join-page.go

@@ -0,0 +1,151 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+	"strings"
+
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+	"github.com/labstack/echo"
+)
+
+type SimpleJoinPageReq struct {
+	QueryVars locals.QueryVars
+	PageVars  locals.PageVars
+	Page      []models_join.CartItemJoin
+}
+
+func SimpleJoinPage(c echo.Context) error {
+
+	v := c.Get("receiver").(SimpleJoinPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vCom := &struct {
+		models_join.SimplePageRet
+	}{}
+	vCom.QueryVars = v.QueryVars
+	vCom.PageVars = v.PageVars
+
+	code := v.QueryVars.QueryName
+
+	if strings.Contains(code, "select-option/") {
+		vRet := &struct {
+			models_join.SimpleSelectOptionPageRet
+		}{}
+
+		vRet.QueryVars = vCom.QueryVars
+		vRet.PageVars = vCom.PageVars
+		if err := vRet.GetPage(&y); err == nil {
+			ret, _ := json.Marshal(vRet)
+			return c.JSONBlob(http.StatusOK, ret)
+		} else {
+			return c.String(607, e.LogStr("453dfaw3rad", "Issue in QueryName: "+v.QueryVars.QueryName))
+		}
+	}
+
+	var ms locals.MapStore
+	if code == "cart-item" {
+		vRet := &struct {
+			models_join.CartItemPageRet
+		}{}
+
+		if err := vCom.SimpleJoinPage(&y, &ms); err != nil {
+			return c.String(607, err.Error())
+		}
+
+		vRet.Page = ms.Get("page").(models_join.CartItemPage).Page
+		vRet.QueryVars = vCom.QueryVars
+		vRet.PageVars = vCom.PageVars
+
+		ret, _ := json.Marshal(vRet)
+		return c.JSONBlob(http.StatusOK, ret)
+
+	} else if code == "sorder-item-total" {
+		vRet := &struct {
+			models_join.SorderItemTotalPageRet
+		}{}
+
+		if err := vCom.SimpleJoinPage(&y, &ms); err != nil {
+			return c.String(607, err.Error())
+		}
+
+		vRet.Page = ms.Get("page").(models_join.SorderItemTotalPage).Page
+		vRet.QueryVars = vCom.QueryVars
+		vRet.PageVars = vCom.PageVars
+
+		ret, _ := json.Marshal(vRet)
+		return c.JSONBlob(http.StatusOK, ret)
+
+	} else if code == "post-member-user" {
+		vRet := &struct {
+			models_join.PostMemberUserPageRet
+		}{}
+
+		if err := vCom.SimpleJoinPage(&y, &ms); err != nil {
+			return c.String(607, err.Error())
+		}
+
+		vRet.Page = ms.Get("page").(models_join.PostMemberUserPage).Page
+		vRet.QueryVars = vCom.QueryVars
+		vRet.PageVars = vCom.PageVars
+
+		ret, _ := json.Marshal(vRet)
+		return c.JSONBlob(http.StatusOK, ret)
+
+		///// Crypto ////
+	} else if code == "my-net-group-wallet" {
+		vRet := &struct {
+			models_join.MyNetGroupWalletPageRet
+		}{}
+
+		if err := vCom.SimpleJoinPage(&y, &ms); err != nil {
+			return c.String(607, err.Error())
+		}
+
+		vRet.Page = ms.Get("page").(models_join.MyNetGroupWalletPage).Page
+		vRet.QueryVars = vCom.QueryVars
+		vRet.PageVars = vCom.PageVars
+
+		ret, _ := json.Marshal(vRet)
+		return c.JSONBlob(http.StatusOK, ret)
+
+	} else if code == "my-wallet-token" {
+		vRet := &struct {
+			models_join.MyWalletTokenPageRet
+		}{}
+
+		if err := vCom.SimpleJoinPage(&y, &ms); err != nil {
+			return c.String(607, err.Error())
+		}
+
+		vRet.Page = ms.Get("page").(models_join.MyWalletTokenPage).Page
+		vRet.QueryVars = vCom.QueryVars
+		vRet.PageVars = vCom.PageVars
+
+		ret, _ := json.Marshal(vRet)
+		return c.JSONBlob(http.StatusOK, ret)
+
+	} else if code == "my-wallet-token-not" {
+		vRet := &struct {
+			models_join.MyWalletTokenNotPageRet
+		}{}
+
+		if err := vCom.SimpleJoinPage(&y, &ms); err != nil {
+			return c.String(607, err.Error())
+		}
+
+		vRet.Page = ms.Get("page").(models_join.MyWalletTokenNotPage).Page
+		vRet.QueryVars = vCom.QueryVars
+		vRet.PageVars = vCom.PageVars
+
+		ret, _ := json.Marshal(vRet)
+		return c.JSONBlob(http.StatusOK, ret)
+
+	} else {
+		return c.String(709, e.LogStr("453dfaw3rad", "QueryName Not Found in JoinPage Controller for '"+v.QueryVars.QueryName+"'"))
+	}
+
+}

+ 43 - 0
controllers/join/jct-slip-search-page.go

@@ -0,0 +1,43 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/locals"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type SlipSearchPageReq struct {
+	QueryVars        locals.QueryVars
+	SlipSearchVars   locals.SlipSearchVars
+	SlipSearchFields locals.SlipSearchFields
+	PageVars         locals.PageVars
+}
+
+func SlipSearchPage(c echo.Context) error {
+
+	v := c.Get("receiver").(SlipSearchPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.SlipSearchPageRet
+	}{}
+
+	vRet.QueryVars = v.QueryVars
+	vRet.SlipSearchVars = v.SlipSearchVars
+	vRet.SlipSearchFields = v.SlipSearchFields
+	vRet.PageVars = v.PageVars
+
+	// fmt.Println(y.Gtb.UserId)
+
+	if err := vRet.GetSlipSearchPage(&y); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+
+}

+ 67 - 0
controllers/join/jct-slip-search-page.go--

@@ -0,0 +1,67 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"net/http"
+	"kkscrap-go/locals"
+	models_themes "kkscrap-go/models/themes"
+	models_join "kkscrap-go/models/join"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+type SlipSearchPageReq struct {
+	QueryVars        locals.QueryVars
+	SlipSearchVars   locals.SlipSearchVars
+	SlipSearchFields locals.SlipSearchFields
+	PageVars         locals.PageVars
+}
+
+func SlipSearchPage(c echo.Context) error {
+
+	v := c.Get("receiver").(SlipSearchPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	slip := v.QueryVars.QueryName
+	if slip == "eyetest" {
+		vRet := &struct {
+			models_themes.EyetestSearchPageRet
+		}{}
+
+		vRet.QueryVars = v.QueryVars
+		vRet.SlipSearchVars = v.SlipSearchVars
+		vRet.SlipSearchFields = v.SlipSearchFields
+		vRet.PageVars = v.PageVars
+
+		// fmt.Println(y.Gtb.UserId)
+
+		if err := vRet.GetEyetestSearchPage(&y); err != nil {
+			return c.String(607, err.Error())
+		}
+
+		ret, _ := json.Marshal(vRet)
+		return c.JSONBlob(http.StatusOK, ret)
+
+	} else {
+
+		vRet := &struct {
+			models_join.SlipSearchPageRet
+		}{}
+
+		vRet.QueryVars = v.QueryVars
+		vRet.SlipSearchVars = v.SlipSearchVars
+		vRet.SlipSearchFields = v.SlipSearchFields
+		vRet.PageVars = v.PageVars
+
+		// fmt.Println(y.Gtb.UserId)
+
+		if err := vRet.GetSlipSearchPage(&y); err != nil {
+			return c.String(607, err.Error())
+		}
+
+		ret, _ := json.Marshal(vRet)
+		return c.JSONBlob(http.StatusOK, ret)
+		// return c.String(709, e.LogStr("234adfq3fae", "QueryName Not Found in SlipSearchBook Controller for '"+slip+"'"))
+	}
+}

+ 29 - 0
controllers/join/jct-user-ext-users.go

@@ -0,0 +1,29 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/controllers"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+func UserExtUsersPage(c echo.Context) error {
+
+	v := c.Get("receiver").(controllers.CommonPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.UserExtUsersPageRet
+	}{}
+
+	vRet.PageVars = v.PageVars
+	if msg, err := vRet.GetUserExtUsersPage(y.Db); err != nil {
+		return c.String(607, msg)
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 29 - 0
controllers/join/jct-user-menu-perm-page.go

@@ -0,0 +1,29 @@
+package controllers_join
+
+import (
+	"encoding/json"
+	"kkscrap-go/controllers"
+	models_join "kkscrap-go/models/join"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo"
+)
+
+func UserMenuPermPage(c echo.Context) error {
+
+	v := c.Get("receiver").(controllers.CommonPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_join.UserMenuPermPageRet
+	}{}
+
+	vRet.PageVars = v.PageVars
+	if msg, err := vRet.GetUserMenuPermPage(y.Db); err != nil {
+		return c.String(607, msg)
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 34 - 0
controllers/scraper/cafe24/parser.go

@@ -0,0 +1,34 @@
+package cafe24
+
+import (
+	"kkscrap-go/controllers/scraper/common"
+	util "kkscrap-go/controllers/scraper/util"
+	"kkscrap-go/model"
+	"strings"
+
+	"github.com/PuerkitoBio/goquery"
+)
+
+func Parse(body string, item *model.ItemInfo) {
+	item.Language = common.GetLanguage(body)
+
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	//s := doc.Find("meta[property=\"og:url\"]")
+	doc.Find("link ~ meta").Each(func(i int, s *goquery.Selection) {
+		v, _ := s.Attr("property")
+		if v == "og:description" {
+			item.ShortDesc = s.AttrOr("content", "")
+		} else if v == "og:title" {
+			item.ItemName = s.AttrOr("content", "")
+		} else if v == "og:image" {
+			item.Images = append(item.Images, s.AttrOr("content", ""))
+		} else if v == "product:price:amount" {
+			item.SalesPrice = util.GetFloat32(s.AttrOr("content", ""))
+		} else if v == "product:price:currency" {
+			item.Currency = s.AttrOr("content", "")
+		}
+	})
+	item.Emails = common.GetEmails(body)
+	return
+}

+ 61 - 0
controllers/scraper/common/parser_common.go

@@ -0,0 +1,61 @@
+package common
+
+import (
+	"kkscrap-go/model"
+	"regexp"
+	"strings"
+
+	util "kkscrap-go/controllers/scraper/util"
+
+	"github.com/PuerkitoBio/goquery"
+)
+
+func GetLanguage(body string) string {
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	ret, _ := doc.Find("html").Attr("lang")
+	return ret
+}
+
+func GetEmails(body string) (ret []string) {
+	reg := regexp.MustCompile("[a-zA-Z0-9.!#$%&*+\\-/=?^_`{|}~]+@[a-z0-9.\\-]+\\.[a-z]+")
+	ss := reg.FindAllStringSubmatch(body, -1)
+	m := make(map[string]bool)
+	for _, s := range ss {
+		e := s[0]
+		if e == "support@crema.me" || e == "support@snapvi.co.kr" || strings.HasPrefix(e, "/") || strings.HasPrefix(e, "http://") ||
+			strings.HasPrefix(e, "https://") || strings.HasSuffix(e, ".png") || strings.HasSuffix(e, ".jpg") || strings.HasSuffix(e, ".js") {
+			continue
+		}
+		m[s[0]] = true
+	}
+	for k, _ := range m {
+		ret = append(ret, k)
+	}
+	return ret
+}
+
+func Parse(uri string, item *model.ItemInfo) {
+	body, err := util.Get(uri)
+	util.CheckError(err)
+
+	item.Language = GetLanguage(body)
+
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	doc.Find("meta").Each(func(i int, s *goquery.Selection) {
+		v, _ := s.Attr("property")
+		if v == "og:description" {
+			item.ShortDesc = s.AttrOr("content", "")
+		} else if v == "og:title" {
+			item.ItemName = s.AttrOr("content", "")
+		} else if v == "og:image" {
+			item.Images = append(item.Images, s.AttrOr("content", ""))
+		} else if v == "product:price:amount" {
+			item.SalesPrice = util.GetFloat32(s.AttrOr("content", ""))
+		} else if v == "product:price:currency" {
+			item.Currency = s.AttrOr("content", "")
+		}
+	})
+	return
+}

+ 17 - 0
controllers/scraper/common/parser_common_test.go

@@ -0,0 +1,17 @@
+package common
+
+import (
+	"github.com/stretchr/testify/assert"
+	"testing"
+)
+
+func TestGetEmails(t *testing.T) {
+	str := `a@naver.com aaaaaaaaaaaaaaaaaaaaaaaaaa ddddddddddddddddd
+dddddddddddddddddd fjskjkfjdkl 하너ㅏㅇ러ㅏ어라ㅓ망 ㄹ어낭러ㅏㄹ
+a_a@gmail.com 러아라ㅓㅏ어ㅏㄹ
+a123@daum.net`
+	//str = "aaa@gmail.com"
+	ss := GetEmails(str)
+
+	assert.EqualValues(t, []string{"a@naver.com", "a_a@gmail.com", "a123@daum.net"}, ss)
+}

+ 60 - 0
controllers/scraper/godo/parser.go

@@ -0,0 +1,60 @@
+package godo
+
+import (
+	"kkscrap-go/controllers/scraper/common"
+	"kkscrap-go/model"
+	"regexp"
+	"strings"
+
+	util "kkscrap-go/controllers/scraper/util"
+
+	"github.com/PuerkitoBio/goquery"
+)
+
+func Parse(body string, item *model.ItemInfo) {
+	item.Language = getLanguage(body)
+
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	doc.Find("meta").Each(func(i int, s *goquery.Selection) {
+		v, _ := s.Attr("property")
+		if v == "og:title" {
+			item.ItemName = s.AttrOr("content", "")
+		} else if v == "og:image" {
+			item.Images = append(item.Images, s.AttrOr("content", ""))
+		} else if v == "product:price:amount" {
+			item.SalesPrice = util.GetFloat32(s.AttrOr("content", ""))
+		} else if v == "product:price:currency" {
+			item.Currency = s.AttrOr("content", "")
+		}
+	})
+	desc := doc.Find("#frmView > div > div > div.item_detail_tit > div").Text()
+	if desc != "" {
+		desc = strings.Split(desc, "\n")[0]
+	}
+	item.ShortDesc = desc
+
+	item.SalesPrice = getPrice(body)
+	item.Currency = getCurrency(body)
+	item.Emails = common.GetEmails(body)
+
+	return
+}
+
+func getLanguage(body string) string {
+	reg, _ := regexp.Compile("var gdLocale = '(.*)';")
+	ss := reg.FindStringSubmatch(body)
+	return ss[1]
+}
+
+func getCurrency(body string) string {
+	reg, _ := regexp.Compile("var gdCurrencyCode = '(.*)';")
+	ss := reg.FindStringSubmatch(body)
+	return ss[1]
+}
+
+func getPrice(body string) float32 {
+	reg, _ := regexp.Compile("'setGoodsPrice'[ ]*:[ ]*'(.*)'")
+	ss := reg.FindStringSubmatch(body)
+	return util.GetFloat32(ss[1])
+}

+ 34 - 0
controllers/scraper/magento/parser.go

@@ -0,0 +1,34 @@
+package magento
+
+import (
+	"kkscrap-go/controllers/scraper/common"
+	"kkscrap-go/model"
+	"strings"
+
+	util "kkscrap-go/controllers/scraper/util"
+
+	"github.com/PuerkitoBio/goquery"
+)
+
+func Parse(body string, item *model.ItemInfo) {
+	item.Language = common.GetLanguage(body)
+
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	doc.Find("meta").Each(func(i int, s *goquery.Selection) {
+		v, _ := s.Attr("property")
+		if v == "og:description" {
+			item.ShortDesc = s.AttrOr("content", "")
+		} else if v == "og:title" {
+			item.ItemName = s.AttrOr("content", "")
+		} else if v == "og:image" {
+			item.Images = append(item.Images, s.AttrOr("content", ""))
+		} else if v == "product:price:amount" {
+			item.SalesPrice = util.GetFloat32(s.AttrOr("content", ""))
+		} else if v == "product:price:currency" {
+			item.Currency = s.AttrOr("content", "")
+		}
+	})
+	item.Emails = common.GetEmails(body)
+	return
+}

+ 34 - 0
controllers/scraper/shopify/parser.go

@@ -0,0 +1,34 @@
+package shopify
+
+import (
+	"kkscrap-go/controllers/scraper/common"
+	"kkscrap-go/model"
+	"strings"
+
+	util "kkscrap-go/controllers/scraper/util"
+
+	"github.com/PuerkitoBio/goquery"
+)
+
+func Parse(body string, item *model.ItemInfo) {
+	item.Language = common.GetLanguage(body)
+
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	doc.Find("meta").Each(func(i int, s *goquery.Selection) {
+		v, _ := s.Attr("property")
+		if v == "og:description" {
+			item.ShortDesc = s.AttrOr("content", "")
+		} else if v == "og:title" {
+			item.ItemName = s.AttrOr("content", "")
+		} else if v == "og:image" {
+			item.Images = append(item.Images, s.AttrOr("content", ""))
+		} else if v == "og:price:amount" {
+			item.SalesPrice = util.GetFloat32(s.AttrOr("content", ""))
+		} else if v == "og:price:currency" {
+			item.Currency = s.AttrOr("content", "")
+		}
+	})
+	item.Emails = common.GetEmails(body)
+	return
+}

+ 13 - 0
controllers/scraper/shopify/parser_test.go

@@ -0,0 +1,13 @@
+package shopify
+
+import (
+	"commerce-crwaler/model"
+	"log"
+	"testing"
+)
+
+func TestShopifyParse(t *testing.T) {
+	item := &model.ItemInfo{}
+	Parse("https://partakefoods.com/products/crunchy-cookie-variety-pack", item)
+	log.Println(item)
+}

+ 245 - 0
controllers/scraper/tct-main.go

@@ -0,0 +1,245 @@
+package controllers_scraper
+
+import (
+	"encoding/json"
+	e "github.com/dabory/abango-rest/etc"
+	"kkscrap-go/controllers/scraper/cafe24"
+	"kkscrap-go/controllers/scraper/godo"
+	"kkscrap-go/controllers/scraper/magento"
+	"kkscrap-go/controllers/scraper/shopify"
+	"kkscrap-go/controllers/scraper/util"
+	"kkscrap-go/controllers/scraper/wordpress"
+	"kkscrap-go/controllers/scraper/young"
+	"kkscrap-go/locals"
+	"kkscrap-go/model"
+	"net/http"
+	"net/url"
+	"regexp"
+	"strings"
+
+	// "golang.org/x/crypto/bcrypt"
+
+	"github.com/labstack/echo"
+)
+
+type SolutionTypeGetReq struct {
+	Url string
+}
+
+func SolutionTypeGet(c echo.Context) error {
+
+	v := c.Get("receiver").(SolutionTypeGetReq)
+
+	retv := &struct {
+		SolutionType string
+		ThemeType    string
+	}{}
+
+	body, err := util.Get(v.Url)
+	if err != nil {
+		return c.JSON(404, err.Error())
+	}
+
+	// fmt.Println(v.Url)
+	st, theme, err := getSolutionType(body)
+	if err != nil {
+		return c.JSONBlob(http.StatusOK, []byte(err.Error()))
+	}
+	retv.SolutionType = string(st)
+	retv.ThemeType = theme
+	return c.JSON(http.StatusOK, retv)
+}
+
+type ProductPageGetReq struct {
+	SolutionType model.SolutionType
+	ThemeType    string
+	Products     []ProductUri
+}
+
+type ProductUri struct {
+	Uri string
+}
+
+// 오리지널 웹사이트 전체를 업테이트 하는 경우 Uri를 하나씩 보내면 비효율적이므로 하나의 배치로
+// 묶어서 요청할 수 있도록 한다. 주로 product-page-get를 쓰고 item-url-scrap은 deprecate 예정임.
+
+func ProductPageGet(c echo.Context) error {
+
+	v := c.Get("receiver").(ProductPageGetReq)
+
+	var vRet locals.ProductPage // Row(개별레코드)->Page(Row의 집합)->Book(Page의 집합)의 개념
+	for _, p := range v.Products {
+
+		body, err := util.Get(p.Uri)
+		if err != nil {
+			e.ErrLog(e.FuncRun("03uoaiuor0", e.CurrFuncName()), err)
+		}
+
+		// 전체 웹사이트가 아니라 개별 상품페이지(1개페이지)의 경우 SolutionType 없이 request됨
+		if v.SolutionType == "" {
+			var err error
+			v.SolutionType, v.ThemeType, err = getSolutionType(body)
+			if err != nil {
+				return c.String(705, "Solution Type Not Found:"+err.Error())
+			}
+		}
+
+		prodInfo := parseSolution(v.SolutionType, v.ThemeType, p.Uri, body)
+		vRet.ProductPage = append(vRet.ProductPage, toProductPage(prodInfo))
+	}
+
+	// ret, _ := json.MarshalIndent(itemInfo, "", "\t")
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}
+
+func toProductPage(info model.ItemInfo) locals.Product {
+	ret := locals.Product{
+		SolutionName:  locals.SolutionType(info.SolutionName),
+		Version:       info.Version,
+		Emails:        info.Emails,
+		DomainName:    info.DomainName,
+		DomainURI:     info.DomainURI,
+		ItemName:      info.ItemName,
+		ItemNick:      info.ItemNick,
+		ModelName:     info.ModelName,
+		ModelNo:       info.ModelNo,
+		BrandName:     info.BrandName,
+		Sku:           info.Sku,
+		ItemCategory:  info.ItemCategory,
+		Manufacturer:  info.Manufacturer,
+		Origin:        info.Origin,
+		Language:      info.Language,
+		Currency:      info.Currency,
+		SalesPrice:    info.SalesPrice,
+		DeliveryPrice: info.DeliveryPrice,
+		MinimumQty:    info.MinimumQty,
+		UserCredit:    info.UserCredit,
+		Options:       nil,
+		Images:        info.Images,
+		ShortDesc:     info.ShortDesc,
+		OriginDesc:    info.OriginDesc,
+		TextDesc:      info.TextDesc,
+	}
+
+	for i, v := range info.Options {
+		ret.Options = append(ret.Options, locals.Option{
+			Name: v.Name,
+		})
+		ret.Options[i].Choices = make([]locals.Choice, 0)
+		for _, choice := range v.Choices {
+			ret.Options[i].Choices = append(ret.Options[i].Choices, locals.Choice{
+				Name:  choice.Name,
+				Price: choice.Price,
+			})
+		}
+	}
+
+	return ret
+}
+
+type ItemUrlScrapReq struct {
+	ItemUrl string
+}
+
+func ItemUrlScrap(c echo.Context) error {
+
+	v := c.Get("receiver").(ItemUrlScrapReq)
+
+	body, err := util.Get(v.ItemUrl)
+	if err != nil {
+		return err
+	}
+
+	itemInfo, err := parse(v.ItemUrl, body)
+	if err != nil {
+		return c.String(604, "ertvwerawqfd-ItemUrl Parse failed: "+err.Error())
+	}
+	ret, _ := json.MarshalIndent(itemInfo, "", "\t")
+	// fmt.Println(string(data))
+
+	// ret, _ := json.Marshal(itemInfo)
+	return c.JSONBlob(http.StatusOK, ret)
+}
+
+var regexpTitle *regexp.Regexp
+
+func init() {
+	regexpTitle, _ = regexp.Compile("<title>(.*)</title>")
+}
+
+func getTitle(body string) string {
+	ss := regexpTitle.FindAllStringSubmatch(body, 1)
+	if len(ss) == 1 {
+		return ss[0][1]
+	}
+	return ""
+}
+
+func parse(uri, body string) (ret model.ItemInfo, err error) {
+	t, theme, err := getSolutionType(body)
+	if err != nil {
+		return
+	}
+	ret = parseSolution(t, theme, uri, body)
+	return
+}
+
+func parseSolution(t model.SolutionType, theme, uri, body string) (ret model.ItemInfo) {
+	ret.SolutionName = t
+	u, err := url.Parse(uri)
+	if err != nil {
+		return
+	}
+	ret.DomainName = u.Host
+	ret.DomainURI = uri
+
+	if t == model.SolutionTypeWooCommerce {
+		wordpress.Parse(body, &ret)
+	} else if t == model.SolutionTypeShopify {
+		shopify.Parse(body, &ret)
+	} else if t == model.SolutionTypeMagento {
+		magento.Parse(body, &ret)
+	} else if t == model.SolutionTypeCafe24 {
+		cafe24.Parse(body, &ret)
+	} else if t == model.SolutionTypeGodo {
+		godo.Parse(body, &ret)
+	} else if t == model.SolutionTypeYoung {
+		young.Parse(body, &ret)
+	} else if t == model.SolutionTypeOthers {
+		magento.Parse(body, &ret)
+	}
+	return
+}
+
+func getSolutionType(body string) (t model.SolutionType, theme string, reterr error) {
+	if strings.Contains(body, "window.CAFE24") {
+		t = model.SolutionTypeCafe24
+	} else if strings.Contains(body, "/wp-content/") {
+		t = model.SolutionTypeWooCommerce
+	} else if strings.Contains(body, "고도몰5") {
+		t = model.SolutionTypeGodo
+	} else if strings.Contains(body, "cdn.shopify.com") {
+		t = model.SolutionTypeShopify
+	} else if strings.Contains(body, "magento") {
+		t = model.SolutionTypeMagento
+	} else if strings.Contains(body, "it_id=") {
+		t = model.SolutionTypeYoung
+	} else {
+		t = model.SolutionTypeOthers
+		//reterr = errors.New("no found solution type")
+	}
+
+	theme = ""
+	re := regexp.MustCompile(`wp-content\/themes\/(.+?)\/`)
+	result := re.FindStringSubmatch(body)
+
+	if len(result) > 1 {
+		theme = result[1]
+	} else {
+		theme = "generic"
+	}
+
+	//ioutil.WriteFile(string(t) + ".html", []byte(body), 644)
+	return
+}

+ 46 - 0
controllers/scraper/tct_test.go

@@ -0,0 +1,46 @@
+package controllers_scraper
+
+import (
+	"kkscrap-go/model"
+	"testing"
+)
+
+func TestToProduct(t *testing.T) {
+	ori := model.ItemInfo{
+		SolutionName:  "hello",
+		Version:       "",
+		Emails:        nil,
+		DomainName:    "",
+		DomainURI:     "",
+		ItemName:      "",
+		ItemNick:      "",
+		ModelName:     "",
+		ModelNo:       "",
+		BrandName:     "",
+		Sku:           "",
+		ItemCategory:  "",
+		Manufacturer:  "",
+		Origin:        "",
+		Language:      "",
+		Currency:      "",
+		SalesPrice:    0,
+		DeliveryPrice: 0,
+		MinimumQty:    0,
+		UserCredit:    0,
+		Options:       nil,
+		Images:        nil,
+		ShortDesc:     "",
+		OriginDesc:    "",
+		TextDesc:      "1234",
+	}
+
+	pro := toProductPage(ori)
+
+	if pro.TextDesc != "1234" {
+		t.Error("TextDesc is not equal")
+	}
+
+	if pro.SolutionName != "hello" {
+		t.Error("SolutionType is not equal")
+	}
+}

+ 63 - 0
controllers/scraper/util/util.go

@@ -0,0 +1,63 @@
+package util
+
+import (
+	"errors"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"strconv"
+)
+
+func CheckError(err error) {
+	if err != nil {
+		panic(err)
+	}
+}
+
+func Get(url string) (body string, err error) {
+
+	if url == "" {
+		err = errors.New("url is empty\n" + url)
+		return
+	}
+
+	req, err := http.NewRequest("GET", url, nil)
+	if err != nil {
+		return "", err
+	}
+	req.Header.Set("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/87.0.4280.88 Safari/537.36")
+
+	fmt.Println("url:", url)
+	resp, err := http.DefaultClient.Do(req)
+	if err != nil {
+		msg := "this site is not available\n" + url
+		if err != nil {
+			msg += "\n" + err.Error()
+		}
+		err = errors.New(msg)
+		return
+	}
+
+	var data []byte
+	defer resp.Body.Close()
+	data, err = ioutil.ReadAll(resp.Body)
+	if err != nil {
+		return
+	}
+	body = string(data)
+
+	if resp.StatusCode != 200 {
+		msg := "this site is not available\n" + url + "\n" + body
+		err = errors.New(msg)
+		return
+	}
+	return
+}
+
+func GetFloat32(s string) float32 {
+	v, err := strconv.ParseFloat(s, 32)
+	if err != nil {
+		v = 0
+	}
+	return float32(v)
+}

+ 161 - 0
controllers/scraper/wordpress/parser.go

@@ -0,0 +1,161 @@
+package wordpress
+
+import (
+	"encoding/json"
+	"fmt"
+	"github.com/PuerkitoBio/goquery"
+	"kkscrap-go/controllers/scraper/common"
+	"kkscrap-go/controllers/scraper/util"
+	"kkscrap-go/model"
+	"regexp"
+	"strings"
+)
+
+func Parse(body string, item *model.ItemInfo) {
+	p := getProduct(body)
+	if p.Image != "" {
+		item.Images = append(item.Images, p.Image)
+	}
+	item.Images = append(item.Images, getImages(body)...)
+	if p.Offers != nil && len(p.Offers) > 0 {
+		item.SalesPrice = util.GetFloat32(p.Offers[0].Price)
+		item.Currency = p.Offers[0].Pricecurrency
+	}
+	item.Sku = fmt.Sprintf("%v", p.Sku)
+	item.ShortDesc = p.Description
+	item.OriginDesc = getProductDescription(body)
+	item.TextDesc = getTextDesc(body)
+	item.ItemName = p.Name
+	item.Language = common.GetLanguage(body)
+	item.Emails = common.GetEmails(body)
+	item.Options = append(item.Options, getOptions(body))
+	return
+}
+
+func getProductDescription(body string) string {
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	s := doc.Find("div.woocommerce-Tabs-panel--description")
+	//s.Each(func(i int, selection *goquery.Selection) {
+	//	log.Println(selection.Html())
+	//})
+	html, err := s.Html()
+	if err != nil {
+		return ""
+	}
+	return html
+}
+
+func getTextDesc(body string) string {
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	text := doc.Find("div.woocommerce-tabs").Text()
+	return text
+}
+
+func getProduct(body string) (ret WordPressProduct) {
+	jsonStr := getJson(body)
+	if idx := strings.Index(jsonStr, "@graph"); idx >= 0 {
+		p := WordPressItem{}
+		json.Unmarshal([]byte(jsonStr), &p)
+		ret = p.Graph[1]
+	} else {
+		json.Unmarshal([]byte(jsonStr), &ret)
+	}
+	return
+}
+
+func getJson(body string) string {
+	idx := strings.Index(body, "<script type=\"application/ld+json\">")
+	if idx < 0 {
+		return ""
+	}
+	body = body[idx+len("<script type=\"application/ld+json\">"):]
+	idx = strings.Index(body, "</script>")
+	body = body[:idx]
+	return body
+}
+
+func getImages(body string) (ret []string) {
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	//doc.Find("img.wp-post-image").Each(func(i int, s *goquery.Selection) {
+	//	if src, ok := s.Attr("src"); ok {
+	//		width, _ := s.Attr("width")
+	//		height, _ := s.Attr("height")
+	//		w, _ := strconv.ParseInt(width, 10, 64)
+	//		h, _ := strconv.ParseInt(height, 10, 64)
+	//		//log.Println(src, width, height)
+	//		ret = append(ret, model.Image{
+	//			Path:   src,
+	//			Width:  int(w),
+	//			Height: int(h),
+	//		})
+	//	}
+	//})
+	//sort.Slice(ret, func(i, j int) bool {
+	//	return ret[i].Width*ret[i].Height > ret[j].Width*ret[j].Height
+	//})
+	//ret = ret[:1]
+
+	re := regexp.MustCompile(`-\d+x\d+\.`)
+	doc.Find("figure.woocommerce-product-gallery__wrapper div").Each(func(i int, s *goquery.Selection) {
+		if src, ok := s.Attr("data-thumb"); ok {
+			newImgUrl := re.ReplaceAllString(src, ".")
+			ret = append(ret, newImgUrl)
+		}
+	})
+
+	return
+}
+
+func getPrice(body string) (ret string) {
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	s := doc.Find("span.woocommerce-Price-amount.amount")
+	s.Each(func(i int, selection *goquery.Selection) {
+		if i == 0 {
+			ret = selection.Text()
+		}
+	})
+	//log.Println(s.Nodes[0].FirstChild.FirstChild.Data)
+	//log.Println(s.Nodes[0].FirstChild.NextSibling.Data)
+	return
+}
+
+func getCategories(body string) (ret string) {
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	s := doc.Find("span.posted_in")
+	ret = s.Text()
+	idx := strings.Index(ret, ":")
+	if idx > 0 {
+		ret = strings.TrimSpace(ret[idx+1:])
+	}
+	//log.Println(s.Nodes[0].FirstChild.FirstChild.Data)
+	//log.Println(s.Nodes[0].FirstChild.NextSibling.Data)
+	return
+}
+
+func getOptions(body string) (ret model.Option) {
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+	s := doc.Find("body select")
+
+	s.Each(func(i int, selection *goquery.Selection) {
+		skippedFistOption := false
+		v, _ := selection.Attr("name")
+		if v != "rating" {
+			selection.Find("option").Each(func(i int, selection *goquery.Selection) {
+				if skippedFistOption {
+					ret.Choices = append(ret.Choices, model.Choice{
+						Name: selection.Text(),
+					})
+				} else {
+					skippedFistOption = true
+				}
+			})
+		}
+	})
+	return
+}

+ 120 - 0
controllers/scraper/wordpress/parser_test.go

@@ -0,0 +1,120 @@
+package wordpress
+
+import (
+	"commerce-crwaler/util"
+	"github.com/stretchr/testify/assert"
+	"os"
+	"testing"
+)
+
+func TestGetImages(t *testing.T) {
+	body, err := util.Get("https://seoulknit.com/shop/collar-half-sleeved-top_blue/")
+	assert.Equal(t, nil, err)
+	imgs := getImages(body)
+	assert.Equal(t, "https://seoulknit.com/wp-content/uploads/2021/05/abito_0594-scaled-454x681.jpg", imgs[0])
+	assert.Equal(t, "https://seoulknit.com/wp-content/uploads/2021/05/abito_0594-scaled-100x100.jpg", imgs[1])
+
+	body, err = util.Get("https://www.dollshecraft.com/product/amanda-beauty-26f-classic-maxi-65cm-special-package-2/")
+	assert.Equal(t, nil, err)
+	imgs = getImages(body)
+	assert.Equal(t, "https://cdn.dollshecraft.com/wp-content/uploads/2018/08/Amanda-Beauty_558743_01.jpg", imgs[0])
+
+	body, err = util.Get("https://www.shoprootscience.com/shop/arctic-c-vitamin-c-serum")
+	assert.Equal(t, nil, err)
+	imgs = getImages(body)
+	assert.Equal(t, "https://www.shoprootscience.com/wp-content/uploads/2020/10/Arctic-C-product-511x634.jpg", imgs[0])
+	assert.Equal(t, "https://www.shoprootscience.com/wp-content/uploads/2020/10/Arctic-C-product.jpg", imgs[1])
+
+	body, err = util.Get("https://strandbergguitars.com/product/boden-6-dr-titanium/")
+	assert.Equal(t, nil, err)
+	imgs = getImages(body)
+	assert.Equal(t, "https://strandbergguitars.com/cdn-cgi/image/onerror=redirect,quality=85,format=auto,metadata=copyright,width=600,height=901,fit=cover/wp-content/uploads/2021/04/bd6ct-20dr-k-p-ti_6.png", imgs[0])
+
+	body, err = util.Get("https://lanbelle.com/product/%EB%9E%91%EB%B2%A8-%EC%88%98%ED%8D%BC%EB%82%B4%EC%B8%84%EB%9F%B4-%ED%81%AC%EB%A6%BC/")
+	assert.Equal(t, nil, err)
+	imgs = getImages(body)
+	assert.Equal(t, "https://strandbergguitars.com/cdn-cgi/image/onerror=redirect,quality=85,format=auto,metadata=copyright,width=600,height=901,fit=cover/wp-content/uploads/2021/04/bd6ct-20dr-k-p-ti_6.png", imgs[0])
+
+}
+
+func TestGetPrice(t *testing.T) {
+	body, err := util.Get("https://seoulknit.com/shop/collar-half-sleeved-top_blue/")
+	assert.Equal(t, nil, err)
+	ret := getPrice(body)
+	assert.Equal(t, "₩ 59,000", ret)
+
+	body, err = util.Get("https://www.dollshecraft.com/product/amanda-beauty-26f-classic-maxi-65cm-special-package-2/")
+	assert.Equal(t, nil, err)
+	ret = getPrice(body)
+	assert.Equal(t, "$1,450.00", ret)
+
+	body, err = util.Get("https://www.shoprootscience.com/shop/arctic-c-vitamin-c-serum")
+	assert.Equal(t, nil, err)
+	ret = getPrice(body)
+	assert.Equal(t, "$110.00", ret)
+
+	body, err = util.Get("https://strandbergguitars.com/product/boden-6-dr-titanium/")
+	assert.Equal(t, nil, err)
+	ret = getPrice(body)
+	assert.Equal(t, "$2,995.00", ret)
+}
+
+func TestGetWordPressProduct(t *testing.T) {
+	body, err := util.Get("https://seoulknit.com/shop/collar-half-sleeved-top_blue/")
+	assert.Equal(t, nil, err)
+	ret := getProduct(body)
+	assert.Equal(t, ret.Sku, float64(5677))
+
+	body, err = util.Get("https://www.shoprootscience.com/shop/arctic-c-vitamin-c-serum")
+	assert.Equal(t, nil, err)
+	ret = getProduct(body)
+	assert.Equal(t, ret.Sku, "FS-ARCC-30")
+
+	body, err = util.Get("https://strandbergguitars.com/product/boden-6-dr-titanium/")
+	assert.Equal(t, nil, err)
+	ret = getProduct(body)
+	assert.Equal(t, "BD6CT-20DRB-K-P-TI", ret.Sku)
+
+	t.Run("상품설명", func(t *testing.T) {
+		body, err := util.Get("https://www.mehisox.com/shop/sn388/")
+		assert.Equal(t, nil, err)
+		html := getProductDescription(body)
+		os.WriteFile("c:\\temp\\test.html", []byte(html), 0644)
+		assert.Equal(t, ``, html)
+	})
+
+}
+
+func TestGetCategories(t *testing.T) {
+	body, err := util.Get("https://seoulknit.com/shop/collar-half-sleeved-top_blue/")
+	assert.Equal(t, nil, err)
+	ret := getCategories(body)
+	assert.Equal(t, ret, "2021SS, Abito angelico, All, New arrivals, Top")
+
+	body, err = util.Get("https://www.shoprootscience.com/shop/arctic-c-vitamin-c-serum")
+	assert.Equal(t, nil, err)
+	ret = getCategories(body)
+	assert.Equal(t, ret, "Treatments")
+
+	body, err = util.Get("https://shopkeeper.wp-theme.design/shop/hoodies/oversize-drawstring-sweatshirt/")
+	assert.Equal(t, nil, err)
+	ret = getCategories(body)
+	assert.Equal(t, ret, "Hoodies, Jackets, Trousers")
+}
+
+func TestGetOptions(t *testing.T) {
+	body, err := util.Get("https://seoulknit.com/shop/collar-half-sleeved-top_blue/")
+	assert.Equal(t, nil, err)
+	ret := getOptions(body)
+	assert.EqualValues(t, ret, []string{"옵션을 선택하세요", "Small", "Midium"})
+
+	body, err = util.Get("https://www.shoprootscience.com/shop/arctic-c-vitamin-c-serum")
+	assert.Equal(t, nil, err)
+	ret = getOptions(body)
+	assert.EqualValues(t, ret, []string(nil))
+
+	body, err = util.Get("https://shopkeeper.wp-theme.design/shop/hoodies/oversize-drawstring-sweatshirt/")
+	assert.Equal(t, nil, err)
+	ret = getOptions(body)
+	assert.EqualValues(t, ret, []string{"Choose an option", "Camel", "Green", "Black", "White", "Choose an option", "XS", "S", "M", "L", "XL"})
+}

+ 35 - 0
controllers/scraper/wordpress/wordpress.go

@@ -0,0 +1,35 @@
+package wordpress
+
+type WordPressProduct struct {
+	Context     string      `json:"@context"`
+	Type        string      `json:"@type"`
+	ID          string      `json:"@id"`
+	Name        string      `json:"name"`
+	URL         string      `json:"url"`
+	Description string      `json:"description"`
+	Image       string      `json:"image"`
+	Sku         interface{} `json:"sku"`
+	Offers      []struct {
+		Type               string `json:"@type"`
+		Price              string `json:"price"`
+		Pricevaliduntil    string `json:"priceValidUntil"`
+		Pricespecification struct {
+			Price                 string `json:"price"`
+			Pricecurrency         string `json:"priceCurrency"`
+			Valueaddedtaxincluded string `json:"valueAddedTaxIncluded"`
+		} `json:"priceSpecification"`
+		Pricecurrency string `json:"priceCurrency"`
+		Availability  string `json:"availability"`
+		URL           string `json:"url"`
+		Seller        struct {
+			Type string `json:"@type"`
+			Name string `json:"name"`
+			URL  string `json:"url"`
+		} `json:"seller"`
+	} `json:"offers"`
+}
+
+type WordPressItem struct {
+	Context string             `json:"@context"`
+	Graph   []WordPressProduct `json:"@graph"`
+}

+ 46 - 0
controllers/scraper/young/parser.go

@@ -0,0 +1,46 @@
+package young
+
+import (
+	"kkscrap-go/controllers/scraper/common"
+	"kkscrap-go/model"
+	"strings"
+
+	util "kkscrap-go/controllers/scraper/util"
+	"regexp"
+
+	"github.com/PuerkitoBio/goquery"
+)
+
+func Parse(body string, item *model.ItemInfo) {
+	item.Language = common.GetLanguage(body)
+
+	doc, err := goquery.NewDocumentFromReader(strings.NewReader(body))
+	util.CheckError(err)
+
+	if len(doc.Find("#sit_title").Nodes) > 0 {
+		item.ItemName = doc.Find("#sit_title").Nodes[0].FirstChild.Data
+	}
+	item.ShortDesc = doc.Find("#sit_desc").Text()
+	item.SalesPrice = util.GetFloat32(doc.Find("#it_price").AttrOr("value", ""))
+	item.Currency = getCurrency(body)
+	item.Images = append(item.Images, doc.Find("#sit_pvi img").AttrOr("src", ""))
+
+	return
+}
+
+func getLanguage(body string) string {
+	reg, _ := regexp.Compile("var gdLocale = '(.*)';")
+	ss := reg.FindStringSubmatch(body)
+	return ss[1]
+}
+
+func getCurrency(body string) string {
+	return "KRW"
+}
+
+func getPrice(body string) string {
+	//`#it_price`
+	reg, _ := regexp.Compile("'setGoodsPrice'[ ]*:[ ]*'(.*)'")
+	ss := reg.FindStringSubmatch(body)
+	return ss[1]
+}

+ 105 - 0
controllers/table/tct-block.go

@@ -0,0 +1,105 @@
+package controllers_table
+
+import (
+	"encoding/json"
+	"kkscrap-go/controllers"
+	"kkscrap-go/locals"
+	models_table "kkscrap-go/models/table"
+	"net/http"
+
+	"github.com/dabory/abango-rest"
+	"github.com/labstack/echo/v4"
+)
+
+type BlockPickReq struct {
+	Page []models_table.EthBlock
+}
+
+type BlockActReq struct {
+	Page []models_table.EthBlock
+}
+
+func BlockPick(c echo.Context) error {
+
+	v := c.Get("receiver").(BlockPickReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		Page []models_table.EthBlock
+	}{}
+
+	for _, row := range v.Page {
+		if err := row.GetaRow(&y); err != nil {
+			return c.String(604, err.Error())
+		}
+		vRet.Page = append(vRet.Page, row)
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}
+
+func BlockAct(c echo.Context) error {
+
+	v := c.Get("receiver").(BlockActReq)
+	y := c.Get("abango").(abango.Controller)
+
+	// var msg string
+	// var accErr error
+	vRet := &locals.IdPageBase{}
+	vIdRet := &locals.IdBase{}
+
+	sess := y.Db.NewSession()
+	defer sess.Close()
+	if err := sess.Begin(); err == nil {
+		for _, row := range v.Page {
+
+			if row.Id == 0 {
+				if err := row.AddaRow(&y); err != nil {
+					sess.Rollback()
+					return c.String(603, err.Error())
+				}
+			} else if row.Id > 0 {
+				if err := row.EditaRow(&y); err != nil {
+					sess.Rollback()
+					return c.String(605, err.Error())
+				}
+			} else if row.Id < 0 {
+				row.Id = -row.Id
+				if err := row.DelaRow(&y); err != nil {
+					sess.Rollback()
+					return c.String(606, err.Error())
+				}
+			}
+			vIdRet.Id = row.Id
+			vRet.Page = append(vRet.Page, *vIdRet)
+		}
+	} else {
+		return c.String(608, "Transaction Action Failed")
+	}
+
+	if err := sess.Commit(); err != nil {
+		return c.String(608, "Transaction Commit Failed")
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}
+
+func BlockPage(c echo.Context) error {
+
+	v := c.Get("receiver").(controllers.CommonPageReq)
+	y := c.Get("abango").(abango.Controller)
+
+	vRet := &struct {
+		models_table.BlockPageRet
+	}{}
+
+	vRet.PageVars = v.PageVars
+	if err := vRet.GetPage(&y); err != nil {
+		return c.String(607, err.Error())
+	}
+
+	ret, _ := json.Marshal(vRet)
+	return c.JSONBlob(http.StatusOK, ret)
+}

+ 45 - 0
go.mod

@@ -0,0 +1,45 @@
+module kkscrap-go
+
+go 1.19
+
+require (
+	github.com/PuerkitoBio/goquery v1.8.1
+	github.com/dabory/abango-rest v0.0.0-20230418035942-9d879f6f9b73
+	github.com/go-xorm/xorm v0.7.9
+	github.com/google/uuid v1.3.0
+	github.com/labstack/echo v3.3.10+incompatible
+	github.com/labstack/echo/v4 v4.10.2
+	github.com/microcosm-cc/bluemonday v1.0.23
+	github.com/stretchr/testify v1.8.2
+	github.com/tidwall/buntdb v1.3.0
+)
+
+require (
+	github.com/andybalholm/cascadia v1.3.1 // indirect
+	github.com/aymerick/douceur v0.2.0 // indirect
+	github.com/davecgh/go-spew v1.1.1 // indirect
+	github.com/dgrijalva/jwt-go v3.2.0+incompatible // indirect
+	github.com/go-sql-driver/mysql v1.7.0 // indirect
+	github.com/gorilla/css v1.0.0 // indirect
+	github.com/kr/pretty v0.3.1 // indirect
+	github.com/labstack/gommon v0.4.0 // indirect
+	github.com/mattn/go-colorable v0.1.13 // indirect
+	github.com/mattn/go-isatty v0.0.17 // indirect
+	github.com/pmezard/go-difflib v1.0.0 // indirect
+	github.com/tidwall/btree v1.4.2 // indirect
+	github.com/tidwall/gjson v1.14.3 // indirect
+	github.com/tidwall/grect v0.1.4 // indirect
+	github.com/tidwall/match v1.1.1 // indirect
+	github.com/tidwall/pretty v1.2.0 // indirect
+	github.com/tidwall/rtred v0.1.2 // indirect
+	github.com/tidwall/tinyqueue v0.1.1 // indirect
+	github.com/valyala/bytebufferpool v1.0.0 // indirect
+	github.com/valyala/fasttemplate v1.2.2 // indirect
+	golang.org/x/crypto v0.6.0 // indirect
+	golang.org/x/net v0.8.0 // indirect
+	golang.org/x/sys v0.6.0 // indirect
+	golang.org/x/text v0.8.0 // indirect
+	gopkg.in/yaml.v3 v3.0.1 // indirect
+	xorm.io/builder v0.3.6 // indirect
+	xorm.io/core v0.7.2-0.20190928055935-90aeac8d08eb // indirect
+)

+ 258 - 0
go.sum

@@ -0,0 +1,258 @@
+cloud.google.com/go v0.26.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.34.0/go.mod h1:aQUYkXzVsufM+DwF1aE+0xfcU+56JwCaLick0ClmMTw=
+cloud.google.com/go v0.37.4 h1:glPeL3BQJsbF6aIIYfZizMwc5LTYz250bDMjttbBGAU=
+cloud.google.com/go v0.37.4/go.mod h1:NHPJ89PdicEuT9hdPXMROBD91xc5uRDxsMtSB16k7hw=
+github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
+github.com/PuerkitoBio/goquery v1.8.1 h1:uQxhNlArOIdbrH1tr0UXwdVFgDcZDrZVdcpygAcwmWM=
+github.com/PuerkitoBio/goquery v1.8.1/go.mod h1:Q8ICL1kNUJ2sXGoAhPGUdYDJvgQgHzJsnnd3H7Ho5jQ=
+github.com/Shopify/sarama v1.19.0/go.mod h1:FVkBWblsNy7DGZRfXLU0O9RCGt5g3g3yEuWXgklEdEo=
+github.com/Shopify/toxiproxy v2.1.4+incompatible/go.mod h1:OXgGpZ6Cli1/URJOF1DMxUHB2q5Ap20/P/eIdh4G0pI=
+github.com/alecthomas/template v0.0.0-20160405071501-a0175ee3bccc/go.mod h1:LOuyumcjzFXgccqObfd/Ljyb9UuFJ6TxHnclSeseNhc=
+github.com/alecthomas/units v0.0.0-20151022065526-2efee857e7cf/go.mod h1:ybxpYRFXyAe+OPACYpWeL0wqObRcbAqCMya13uyzqw0=
+github.com/andybalholm/cascadia v1.3.1 h1:nhxRkql1kdYCc8Snf7D5/D3spOX+dBgjA6u8x004T2c=
+github.com/andybalholm/cascadia v1.3.1/go.mod h1:R4bJ1UQfqADjvDa4P6HZHLh/3OxWWEqc0Sk8XGwHqvA=
+github.com/apache/thrift v0.12.0/go.mod h1:cp2SuWMxlEZw2r+iP2GNCdIi4C1qmUzdZFSVb+bacwQ=
+github.com/aymerick/douceur v0.2.0 h1:Mv+mAeH1Q+n9Fr+oyamOlAkUNPWPlA8PPGR0QAaYuPk=
+github.com/aymerick/douceur v0.2.0/go.mod h1:wlT5vV2O3h55X9m7iVYN0TBM0NH/MmbLnd30/FjWUq4=
+github.com/beorn7/perks v0.0.0-20180321164747-3a771d992973/go.mod h1:Dwedo/Wpr24TaqPxmxbtue+5NUziq4I4S80YR8gNf3Q=
+github.com/client9/misspell v0.3.4/go.mod h1:qj6jICC3Q7zFZvVWo7KLAzC3yx5G7kyvSDkc90ppPyw=
+github.com/cockroachdb/apd v1.1.0/go.mod h1:8Sl8LxpKi29FqWXR16WEFZRNSz3SoPzUzeMeY4+DwBQ=
+github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
+github.com/dabory/abango-rest v0.0.0-20230418035942-9d879f6f9b73 h1:u+Q/sdD7aGI4MuwBFa6jcRzFyTDug91HlqzVOPl5DSc=
+github.com/dabory/abango-rest v0.0.0-20230418035942-9d879f6f9b73/go.mod h1:BrKYpdakgK/aVl0n4zHRidJKadb5MI673CS0EhKCDIE=
+github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
+github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
+github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4 h1:YcpmyvADGYw5LqMnHqSkyIELsHCGF6PkrmM31V8rF7o=
+github.com/denisenkom/go-mssqldb v0.0.0-20190707035753-2be1aa521ff4/go.mod h1:zAg7JM8CkOJ43xKXIj7eRO9kmWm/TW578qo+oDO6tuM=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible h1:7qlOGliEKZXTDg6OTjfoBKDXWrumCAMpl/TFQ4/5kLM=
+github.com/dgrijalva/jwt-go v3.2.0+incompatible/go.mod h1:E3ru+11k8xSBh+hMPgOLZmtrrCbhqsmaPHjLKYnJCaQ=
+github.com/eapache/go-resiliency v1.1.0/go.mod h1:kFI+JgMyC7bLPUVY133qvEBtVayf5mFgVsvEsIPBvNs=
+github.com/eapache/go-xerial-snappy v0.0.0-20180814174437-776d5712da21/go.mod h1:+020luEh2TKB4/GOp8oxxtq0Daoen/Cii55CzbTV6DU=
+github.com/eapache/queue v1.1.0/go.mod h1:6eCeP0CKFpHLu8blIFXhExK/dRa7WDZfr6jVFPTqq+I=
+github.com/fsnotify/fsnotify v1.4.7/go.mod h1:jwhsz4b93w/PPRr/qN1Yymfu8t87LnFCMoQvtojpjFo=
+github.com/go-kit/kit v0.8.0/go.mod h1:xBxKIO96dXMWWy0MnWVtmwkA9/13aqxPnvrjFYMA2as=
+github.com/go-logfmt/logfmt v0.3.0/go.mod h1:Qt1PoO58o5twSAckw1HlFXLmHsOX5/0LbT9GBnD5lWE=
+github.com/go-sql-driver/mysql v1.4.1/go.mod h1:zAC/RDZ24gD3HViQzih4MyKcchzm+sOG5ZlKdlhCg5w=
+github.com/go-sql-driver/mysql v1.7.0 h1:ueSltNNllEqE3qcWBTD0iQd3IpL/6U+mJxLkazJ7YPc=
+github.com/go-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
+github.com/go-stack/stack v1.8.0/go.mod h1:v0f6uXyyMGvRgIKkXu+yp6POWl0qKG85gN/melR3HDY=
+github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a h1:9wScpmSP5A3Bk8V3XHWUcJmYTh+ZnlHVyc+A4oZYS3Y=
+github.com/go-xorm/sqlfiddle v0.0.0-20180821085327-62ce714f951a/go.mod h1:56xuuqnHyryaerycW3BfssRdxQstACi0Epw/yC5E2xM=
+github.com/go-xorm/xorm v0.7.9 h1:LZze6n1UvRmM5gpL9/U9Gucwqo6aWlFVlfcHKH10qA0=
+github.com/go-xorm/xorm v0.7.9/go.mod h1:XiVxrMMIhFkwSkh96BW7PACl7UhLtx2iJIHMdmjh5sQ=
+github.com/gofrs/uuid v3.2.0+incompatible/go.mod h1:b2aQJv3Z4Fp6yNu3cdSllBxTCLRxnplIgP/c0N/04lM=
+github.com/gogo/protobuf v1.1.1/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/gogo/protobuf v1.2.0/go.mod h1:r8qH/GZQm5c6nD/R0oafs1akxWv10x8SbQlK7atdtwQ=
+github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
+github.com/golang/mock v1.1.1/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/mock v1.2.0/go.mod h1:oTYuIxOrZwtPieC+H1uAHpcLFnEyAGVDL/k47Jfbm0A=
+github.com/golang/protobuf v1.2.0/go.mod h1:6lQm79b+lXiMfvg/cZm0SGofjICqVBUtrP5yJMmIC1U=
+github.com/golang/snappy v0.0.0-20180518054509-2e65f85255db/go.mod h1:/XxbfmMg8lxefKM7IXC3fBNl/7bRcc72aCRzEWrmP2Q=
+github.com/google/btree v0.0.0-20180813153112-4030bb1f1f0c/go.mod h1:lNA+9X1NB3Zf8V7Ke586lFgjr2dZNuvo3lPJSGZ5JPQ=
+github.com/google/go-cmp v0.2.0/go.mod h1:oXzfMopK8JAjlY9xF4vHSVASa0yLyX7SntLO5aqRK0M=
+github.com/google/martian v2.1.0+incompatible/go.mod h1:9I4somxYTbIHy5NJKHRl3wXiIaQGbYVAs8BPL6v8lEs=
+github.com/google/pprof v0.0.0-20181206194817-3ea8567a2e57/go.mod h1:zfwlbNMJ+OItoe0UupaVj+oy1omPYYDuagoSzA8v9mc=
+github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
+github.com/google/uuid v1.3.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
+github.com/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
+github.com/gorilla/context v1.1.1/go.mod h1:kBGZzfjB9CEq2AlWe17Uuf7NDRt0dE0s8S51q0aT7Yg=
+github.com/gorilla/css v1.0.0 h1:BQqNyPTi50JCFMTw/b67hByjMVXZRwGha6wxVGkeihY=
+github.com/gorilla/css v1.0.0/go.mod h1:Dn721qIggHpt4+EFCcTLTU/vk5ySda2ReITrtgBl60c=
+github.com/gorilla/mux v1.6.2/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
+github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
+github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpOxQnU=
+github.com/jackc/fake v0.0.0-20150926172116-812a484cc733/go.mod h1:WrMFNQdiFJ80sQsxDoMokWK1W5TQtxBFNpzWTD84ibQ=
+github.com/jackc/pgx v3.6.0+incompatible/go.mod h1:0ZGrqGqkRlliWnWB4zKnWtjbSWbGkVEFm4TeybAXq+I=
+github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
+github.com/julienschmidt/httprouter v1.2.0/go.mod h1:SYymIcj16QtmaHHD7aYtjjsJG7VTCxuUUipMqKk8s4w=
+github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
+github.com/konsorten/go-windows-terminal-sequences v1.0.1/go.mod h1:T0+1ngSBFLxvqU3pZ+m/2kptfBszLMUkC4ZK/EgS/cQ=
+github.com/kr/logfmt v0.0.0-20140226030751-b84e30acd515/go.mod h1:+0opPa2QZZtGFBFZlji/RkVcI2GknAs/DXo4wKdlNEc=
+github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
+github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
+github.com/kr/text v0.2.0 h1:5Nx0Ya0ZqY2ygV366QzturHI13Jq95ApcVaJBhpS+AY=
+github.com/kr/text v0.2.0/go.mod h1:eLer722TekiGuMkidMxC/pM04lWEeraHUUmBw8l2grE=
+github.com/labstack/echo v3.3.10+incompatible h1:pGRcYk231ExFAyoAjAfD85kQzRJCRI8bbnE7CX5OEgg=
+github.com/labstack/echo v3.3.10+incompatible/go.mod h1:0INS7j/VjnFxD4E2wkz67b8cVwCLbBmJyDaka6Cmk1s=
+github.com/labstack/echo/v4 v4.10.2 h1:n1jAhnq/elIFTHr1EYpiYtyKgx4RW9ccVgkqByZaN2M=
+github.com/labstack/echo/v4 v4.10.2/go.mod h1:OEyqf2//K1DFdE57vw2DRgWY0M7s65IVQO2FzvI4J5k=
+github.com/labstack/gommon v0.4.0 h1:y7cvthEAEbU0yHOf4axH8ZG2NH8knB9iNSoTO8dyIk8=
+github.com/labstack/gommon v0.4.0/go.mod h1:uW6kP17uPlLJsD3ijUYn3/M5bAxtlZhMI6m3MFxTMTM=
+github.com/lib/pq v1.0.0 h1:X5PMW56eZitiTeO7tKzZxFCSpbFZJtkMMooicw2us9A=
+github.com/lib/pq v1.0.0/go.mod h1:5WUZQaWbwv1U+lTReE5YruASi9Al49XbQIvNi/34Woo=
+github.com/mattn/go-colorable v0.1.11/go.mod h1:u5H1YNBxpqRaxsYJYSkiCWKzEfiAb1Gb520KVy5xxl4=
+github.com/mattn/go-colorable v0.1.13 h1:fFA4WZxdEF4tXPZVKMLwD8oUnCTTo08duU7wxecdEvA=
+github.com/mattn/go-colorable v0.1.13/go.mod h1:7S9/ev0klgBDR4GtXTXX8a3vIGJpMovkB8vQcUbaXHg=
+github.com/mattn/go-isatty v0.0.14/go.mod h1:7GGIvUiUoEMVVmxf/4nioHXj79iQHKdU27kJ6hsGG94=
+github.com/mattn/go-isatty v0.0.16/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
+github.com/mattn/go-isatty v0.0.17 h1:BTarxUcIeDqL27Mc+vyvdWYSL28zpIhv3RoTdsLMPng=
+github.com/mattn/go-isatty v0.0.17/go.mod h1:kYGgaQfpe5nmfYZH+SKPsOc2e4SrIfOl2e/yFXSvRLM=
+github.com/mattn/go-sqlite3 v1.10.0 h1:jbhqpg7tQe4SupckyijYiy0mJJ/pRyHvXf7JdWK860o=
+github.com/mattn/go-sqlite3 v1.10.0/go.mod h1:FPy6KqzDD04eiIsT53CuJW3U88zkxoIYsOqkbpncsNc=
+github.com/matttproud/golang_protobuf_extensions v1.0.1/go.mod h1:D8He9yQNgCq6Z5Ld7szi9bcBfOoFv/3dc6xSMkL2PC0=
+github.com/microcosm-cc/bluemonday v1.0.23 h1:SMZe2IGa0NuHvnVNAZ+6B38gsTbi5e4sViiWJyDDqFY=
+github.com/microcosm-cc/bluemonday v1.0.23/go.mod h1:mN70sk7UkkF8TUr2IGBpNN0jAgStuPzlK76QuruE/z4=
+github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
+github.com/onsi/ginkgo v1.6.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/ginkgo v1.7.0/go.mod h1:lLunBs/Ym6LB5Z9jYTR76FiuTmxDTDusOGeTQH+WWjE=
+github.com/onsi/gomega v1.4.3/go.mod h1:ex+gbHU/CVuBBDIJjb2X0qEXbFg53c61hWP/1CpauHY=
+github.com/openzipkin/zipkin-go v0.1.6/go.mod h1:QgAqvLzwWbR/WpD4A3cGpPtJrZXNIiJc5AZX7/PBEpw=
+github.com/pierrec/lz4 v2.0.5+incompatible/go.mod h1:pdkljMzZIN41W+lC3N2tnIh5sFi+IEE17M5jbnwPHcY=
+github.com/pkg/diff v0.0.0-20210226163009-20ebb0f2a09e/go.mod h1:pJLUxLENpZxwdsKMEsNbx1VGcRFpLqf3715MtcvvzbA=
+github.com/pkg/errors v0.8.0/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
+github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
+github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
+github.com/prometheus/client_golang v0.9.3-0.20190127221311-3c4408c8b829/go.mod h1:p2iRAGwDERtqlqzRXnrOVns+ignqQo//hLXqYxZYVNs=
+github.com/prometheus/client_model v0.0.0-20180712105110-5c3871d89910/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/client_model v0.0.0-20190115171406-56726106282f/go.mod h1:MbSGuTsp3dbXC40dX6PRTWyKYBIrTGTE9sqQNg2J8bo=
+github.com/prometheus/common v0.2.0/go.mod h1:TNfzLD0ON7rHzMJeJkieUDPYmFC7Snx/y86RQel1bk4=
+github.com/prometheus/procfs v0.0.0-20181005140218-185b4288413d/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/prometheus/procfs v0.0.0-20190117184657-bf6a532e95b1/go.mod h1:c3At6R/oaqEKCNdg8wHV1ftS6bRYblBhIjjI8uT2IGk=
+github.com/rcrowley/go-metrics v0.0.0-20181016184325-3113b8401b8a/go.mod h1:bCqnVzQkZxMG4s8nGwiZ5l3QUCyqpo9Y+/ZMZ9VjZe4=
+github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
+github.com/rogpeppe/go-internal v1.9.0/go.mod h1:WtVeX8xhTBvf0smdhujwtBcq4Qrzq/fJaraNFVN+nFs=
+github.com/shopspring/decimal v0.0.0-20180709203117-cd690d0c9e24/go.mod h1:M+9NzErvs504Cn4c5DxATwIqPbtswREoFCre64PpcG4=
+github.com/sirupsen/logrus v1.2.0/go.mod h1:LxeOpSwHxABJmUn/MG1IvRgCAasNZTLOkJPxbbu5VWo=
+github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME=
+github.com/stretchr/objx v0.1.1/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.2.2/go.mod h1:a8OnRcib4nhh0OaRAV+Yts87kKdq0PP7pXfy6kDkUVs=
+github.com/stretchr/testify v1.3.0/go.mod h1:M5WIy9Dh21IEIfnGCwXGc5bZfKNJtfHm1UVUgZn+9EI=
+github.com/stretchr/testify v1.4.0/go.mod h1:j7eGeouHqKxXV5pUuKE4zz7dFj8WfuZ+81PSLYec5m4=
+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.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
+github.com/stretchr/testify v1.8.2/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
+github.com/tidwall/assert v0.1.0 h1:aWcKyRBUAdLoVebxo95N7+YZVTFF/ASTr7BN4sLP6XI=
+github.com/tidwall/btree v1.4.2 h1:PpkaieETJMUxYNADsjgtNRcERX7mGc/GP2zp/r5FM3g=
+github.com/tidwall/btree v1.4.2/go.mod h1:LGm8L/DZjPLmeWGjv5kFrY8dL4uVhMmzmmLYmsObdKE=
+github.com/tidwall/buntdb v1.3.0 h1:gdhWO+/YwoB2qZMeAU9JcWWsHSYU3OvcieYgFRS0zwA=
+github.com/tidwall/buntdb v1.3.0/go.mod h1:lZZrZUWzlyDJKlLQ6DKAy53LnG7m5kHyrEHvvcDmBpU=
+github.com/tidwall/gjson v1.12.1/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
+github.com/tidwall/gjson v1.14.3 h1:9jvXn7olKEHU1S9vwoMGliaT8jq1vJ7IH/n9zD9Dnlw=
+github.com/tidwall/gjson v1.14.3/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
+github.com/tidwall/grect v0.1.4 h1:dA3oIgNgWdSspFzn1kS4S/RDpZFLrIxAZOdJKjYapOg=
+github.com/tidwall/grect v0.1.4/go.mod h1:9FBsaYRaR0Tcy4UwefBX/UDcDcDy9V5jUcxHzv2jd5Q=
+github.com/tidwall/lotsa v1.0.2 h1:dNVBH5MErdaQ/xd9s769R31/n2dXavsQ0Yf4TMEHHw8=
+github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
+github.com/tidwall/match v1.1.1/go.mod h1:eRSPERbgtNPcGhD8UCthc6PmLEQXEWd3PRB5JTxsfmM=
+github.com/tidwall/pretty v1.2.0 h1:RWIZEg2iJ8/g6fDDYzMpobmaoGh5OLl4AXtGUGPcqCs=
+github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhsoaGGjNU=
+github.com/tidwall/rtred v0.1.2 h1:exmoQtOLvDoO8ud++6LwVsAMTu0KPzLTUrMln8u1yu8=
+github.com/tidwall/rtred v0.1.2/go.mod h1:hd69WNXQ5RP9vHd7dqekAz+RIdtfBogmglkZSRxCHFQ=
+github.com/tidwall/tinyqueue v0.1.1 h1:SpNEvEggbpyN5DIReaJ2/1ndroY8iyEGxPYxoSaymYE=
+github.com/tidwall/tinyqueue v0.1.1/go.mod h1:O/QNHwrnjqr6IHItYrzoHAKYhBkLI67Q096fQP5zMYw=
+github.com/valyala/bytebufferpool v1.0.0 h1:GqA5TC/0021Y/b9FG4Oi9Mr3q7XYx6KllzawFIhcdPw=
+github.com/valyala/bytebufferpool v1.0.0/go.mod h1:6bBcMArwyJ5K/AmCkWv1jt77kVWyCJ6HpOuEn7z0Csc=
+github.com/valyala/fasttemplate v1.2.1/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
+github.com/valyala/fasttemplate v1.2.2 h1:lxLXG0uE3Qnshl9QyaK6XJxMXlQZELvChBOCmQD0Loo=
+github.com/valyala/fasttemplate v1.2.2/go.mod h1:KHLXt3tVN2HBp8eijSv/kGJopbvo7S+qRAEEKiv+SiQ=
+github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
+github.com/ziutek/mymysql v1.5.4 h1:GB0qdRGsTwQSBVYuVShFBKaXSnSnYYC2d9knnE1LHFs=
+github.com/ziutek/mymysql v1.5.4/go.mod h1:LMSpPZ6DbqWFxNCHW77HeMg9I646SAhApZ/wKdgO/C0=
+go.opencensus.io v0.20.1/go.mod h1:6WKK9ahsWS3RSO+PY9ZHZUfv2irvY6gN279GOPZjmmk=
+golang.org/x/crypto v0.0.0-20180904163835-0709b304e793/go.mod h1:6SG95UA2DQfeDnfUPMdvaQW0Q7yPrPDi9nlGo2tz2b4=
+golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20190325154230-a5d413f7728c/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
+golang.org/x/crypto v0.6.0 h1:qfktjS5LUO+fFKeJXZ+ikTRijMmljikvG68fpMMruSc=
+golang.org/x/crypto v0.6.0/go.mod h1:OFC/31mSvZgRz0V1QTNCzfAI1aIRzbiufJtkMIlEp58=
+golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
+golang.org/x/lint v0.0.0-20181026193005-c67002cb31c3/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/lint v0.0.0-20190227174305-5b3e6a55c961/go.mod h1:wehouNa3lNwaWXcvxsM5YxQ5yQlVC4a0KAMCusXpPoU=
+golang.org/x/lint v0.0.0-20190301231843-5614ed5bae6f/go.mod h1:UVdnD1Gm6xHRNCYTkRU2/jEulfH38KcIWyp/GAMgvoE=
+golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
+golang.org/x/net v0.0.0-20180724234803-3673e40ba225/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180826012351-8a410e7b638d/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20180906233101-161cd47e91fd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20181114220301-adae6a3d119a/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190125091013-d26f9f9a57f3/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190213061140-3a22650c66bd/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
+golang.org/x/net v0.0.0-20190311183353-d8887717615a/go.mod h1:t9HGtf8HONx5eT2rtn7q6eTqICYqUVnKs3thJo3Qplg=
+golang.org/x/net v0.0.0-20190620200207-3b0461eec859/go.mod h1:z5CRVTTTmAJ677TzLLGU+0bjPO0LkuOLi4/5GtJWs/s=
+golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
+golang.org/x/net v0.0.0-20210916014120-12bc252f5db8/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
+golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
+golang.org/x/net v0.7.0/go.mod h1:2Tu9+aMcznHK/AK1HMvgo6xiTLG5rD5rZLDS+rp2Bjs=
+golang.org/x/net v0.8.0 h1:Zrh2ngAOFYneWTAIAPethzeaQLuHwhuBkuV6ZiRnUaQ=
+golang.org/x/net v0.8.0/go.mod h1:QVkue5JL9kW//ek3r6jTKnTFis1tRmNAW2P1shuFdJc=
+golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
+golang.org/x/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
+golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181108010431-42b317875d0f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190227155943-e225da77a7e6/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sync v0.0.0-20220722155255-886fb9371eb4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
+golang.org/x/sys v0.0.0-20180830151530-49385e6e1522/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180905080454-ebe1bf3edb33/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20180909124046-d0be0721c37e/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181116152217-5ac8a444bdc5/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20181122145206-62eef0e2fa9b/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
+golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
+golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210630005230-0f9fa26af87c/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20210927094055-39ccf1dd6fa6/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20211103235746-7861aae1554b/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220520151302-bc2c85ada10a/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.5.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/sys v0.6.0 h1:MVltZSvRTcU2ljQOhs94SXPftV6DCNnZViHeQps87pQ=
+golang.org/x/sys v0.6.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
+golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=
+golang.org/x/term v0.0.0-20210927222741-03fcf44c2211/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
+golang.org/x/term v0.5.0/go.mod h1:jMB1sMXY+tzblOD4FWmEbocvup2/aLOaQEp7JmGp78k=
+golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
+golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
+golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
+golang.org/x/text v0.7.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
+golang.org/x/text v0.8.0 h1:57P1ETyNKtuIjB4SRd15iJxuhj8Gc416Y78H3qgMh68=
+golang.org/x/text v0.8.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
+golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
+golang.org/x/tools v0.0.0-20180828015842-6cd1fcedba52/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20180917221912-90fa682c2a6e/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190114222345-bf090417da8b/go.mod h1:n7NCudcB/nEzxVGmLbDWY5pfWTLqBcC2KZ6jyYvM4mQ=
+golang.org/x/tools v0.0.0-20190226205152-f727befe758c/go.mod h1:9Yl7xja0Znq3iFh3HoIrodX9oNMXvdceNzlUR8zjMvY=
+golang.org/x/tools v0.0.0-20190312170243-e65039ee4138/go.mod h1:LCzVGOaR6xXOjkQ3onu1FJEFr0SW1gC7cKk1uF8kGRs=
+golang.org/x/tools v0.0.0-20191119224855-298f0cb1881e/go.mod h1:b+2E5dAYhXwXZwtnZ6UAqBI28+e2cm9otk0dWdXHAEo=
+golang.org/x/tools v0.1.12/go.mod h1:hNGJHUnrk76NpqgfD5Aqm5Crs+Hm0VOH/i9J2+nxYbc=
+golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
+google.golang.org/api v0.3.1/go.mod h1:6wY9I6uQWHQ8EM57III9mq/AjF+i8G65rmVagqKMtkk=
+google.golang.org/appengine v1.1.0/go.mod h1:EbEs0AVv82hx2wNQdGPgUI5lhzA/G0D9YwlJXL52JkM=
+google.golang.org/appengine v1.4.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/appengine v1.6.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7/EB5XEv4=
+google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
+google.golang.org/genproto v0.0.0-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/genproto v0.0.0-20190404172233-64821d5d2107/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
+google.golang.org/grpc v1.17.0/go.mod h1:6QZJwpn2B+Zp71q/5VxRsJ6NXXVCE5NRUHRo+f3cWCs=
+google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
+gopkg.in/alecthomas/kingpin.v2 v2.2.6/go.mod h1:FMv+mEhP44yOT+4EoQTLFTRgOQ1FBLkstjWtayDeSgw=
+gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127 h1:qIbj1fsPNlZgppZ+VLlY7N33q108Sa+fhmuc+sWQYwY=
+gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
+gopkg.in/fsnotify.v1 v1.4.7/go.mod h1:Tz8NjZHkW78fSQdbUxIjBTcgA1z1m8ZHf0WmKUhAMys=
+gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7/go.mod h1:dt/ZhP58zS4L8KSrWDmTeBkI65Dw0HsyUHuEVlX15mw=
+gopkg.in/yaml.v2 v2.2.1/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
+gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
+gopkg.in/yaml.v3 v3.0.0-20210107192922-496545a6307b/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=
+honnef.co/go/tools v0.0.0-20180728063816-88497007e858/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190102054323-c2f93a96b099/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+honnef.co/go/tools v0.0.0-20190106161140-3f1c8253044a/go.mod h1:rf3lG4BRIbNafJWhAfAdb/ePZxsR/4RtNHQocxwk9r4=
+xorm.io/builder v0.3.6 h1:ha28mQ2M+TFx96Hxo+iq6tQgnkC9IZkM6D8w9sKHHF8=
+xorm.io/builder v0.3.6/go.mod h1:LEFAPISnRzG+zxaxj2vPicRwz67BdhFreKg8yv8/TgU=
+xorm.io/core v0.7.2-0.20190928055935-90aeac8d08eb h1:msX3zG3BPl8Ti+LDzP33/9K7BzO/WqFXk610K1kYKfo=
+xorm.io/core v0.7.2-0.20190928055935-90aeac8d08eb/go.mod h1:jJfd0UAEzZ4t87nbQYtVjmqpIODugN6PD2D9E+dJvdM=

+ 21 - 0
goget.sh

@@ -0,0 +1,21 @@
+
+go get xorm.io/xorm 
+go get github.com/pilu/fresh
+go get github.com/go-sql-driver/mysql
+go get -u github.com/labstack/echo
+
+go get github.com/dgrijalva/jwt-go
+go get github.com/go-session/session
+go get -u gopkg.in/oauth2.v3
+#go get -u github.com/go-oauth2/oauth2
+#go get -u github.com/google/uuid
+
+# buntdb 가 없으면 oauth2 store가 작동이 안된다.
+go get -u github.com/tidwall/buntdb
+
+go get -u github.com/dabory/abango-rest
+
+go get golang.org/x/oauth2
+go get golang.org/x/oauth2/google
+go get github.com/gorilla/sessions
+go get github.com/labstack/echo-contrib/session

+ 95 - 0
locals/cipher-func.go

@@ -0,0 +1,95 @@
+package locals
+
+import (
+	"bytes"
+	"crypto/aes"
+	"crypto/cipher"
+	"crypto/rand"
+	"encoding/base64"
+	"errors"
+	"io"
+	"strings"
+
+	e "github.com/dabory/abango-rest/etc"
+)
+
+//if keysize is 16bytes * 8bits -> 128
+//if keysize is 32bytes * 8bits -> 256
+//Encrypt-Decript는 plaintext가 16bytes 밖에는 지원하지 않는다 따라서
+//MyAesEncrypt를 사용한다.
+func MyAesEncrypt(key []byte, text []byte) ([]byte, error) {
+
+	block, err := aes.NewCipher(key)
+	if err != nil {
+		return nil, errors.New(e.FuncRunErr("odvjkwei3", e.CurrFuncName()+" "+err.Error()))
+	}
+
+	msg := Pad(text)
+	ciphertext := make([]byte, aes.BlockSize+len(msg))
+	iv := ciphertext[:aes.BlockSize]
+	if _, err := io.ReadFull(rand.Reader, iv); err != nil {
+		return nil, errors.New(e.FuncRunErr("ls0ue3so", e.CurrFuncName()+" "+err.Error()))
+	}
+
+	cfb := cipher.NewCFBEncrypter(block, iv)
+	cfb.XORKeyStream(ciphertext[aes.BlockSize:], msg)
+	finalMsg := removeBase64Padding(base64.URLEncoding.EncodeToString(ciphertext))
+
+	return []byte(finalMsg), nil
+}
+
+func MyAesDecrypt(key []byte, text []byte) ([]byte, error) {
+
+	block, err := aes.NewCipher(key)
+	if err != nil {
+		return nil, errors.New(e.FuncRunErr("3do8awe", e.CurrFuncName()+" "+err.Error()))
+	}
+	decodedMsg, err := base64.URLEncoding.DecodeString(addBase64Padding(string(text)))
+	if err != nil {
+		return nil, errors.New(e.FuncRunErr("mkshewjd", e.CurrFuncName()+" "+err.Error()))
+	}
+
+	if (len(decodedMsg) % aes.BlockSize) != 0 {
+		return nil, errors.New(e.FuncRunErr("mskoeuwid", e.CurrFuncName()+" "+err.Error()))
+	}
+
+	iv := decodedMsg[:aes.BlockSize]
+	msg := decodedMsg[aes.BlockSize:]
+
+	cfb := cipher.NewCFBDecrypter(block, iv)
+	cfb.XORKeyStream(msg, msg)
+
+	unpadMsg, err := Unpad(msg)
+	if err != nil {
+		return nil, errors.New(e.FuncRunErr("012bsoo832d", e.CurrFuncName()+" "+err.Error()))
+	}
+	return unpadMsg, nil
+}
+
+func Pad(src []byte) []byte {
+	padding := aes.BlockSize - len(src)%aes.BlockSize
+	padtext := bytes.Repeat([]byte{byte(padding)}, padding)
+	return append(src, padtext...)
+}
+
+func Unpad(src []byte) ([]byte, error) {
+	length := len(src)
+	unpadding := int(src[length-1])
+
+	if unpadding > length {
+		return nil, errors.New(e.FuncRunErr("unpad error. This could happen when incorrect MyAesEncryption key is used", e.CurrFuncName()))
+	}
+	return src[:(length - unpadding)], nil
+}
+
+func addBase64Padding(value string) string {
+	m := len(value) % 4
+	if m != 0 {
+		value += strings.Repeat("=", 4-m)
+	}
+	return value
+}
+
+func removeBase64Padding(value string) string {
+	return strings.Replace(value, "=", "", -1)
+}

+ 494 - 0
locals/common-func-dev.go

@@ -0,0 +1,494 @@
+//go:build dev
+// +build dev
+
+package locals
+
+import (
+	"bytes"
+	"crypto/sha256"
+	"encoding/base64"
+	"encoding/json"
+	"errors"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"strings"
+	"time"
+
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+	"github.com/go-xorm/xorm"
+	"github.com/microcosm-cc/bluemonday"
+)
+
+const (
+	// Tpf string = "dbr_" // TablePrefix
+	//QueryComment
+	QcWhere        string = "-- @where"
+	QcSubWhere     string = "-- @subwhere"
+	QcHaving       string = "-- @having"
+	QcOrder        string = "-- @order"
+	QcLimitOffset  string = "-- @limitoffset"
+	QcExtract      string = "-- @extract:"
+	QcClosed       string = "-- @closed:"
+	QcDelivery     string = "-- @delivery:"
+	QcBetweenDates string = "-- @between_dates"
+	QcEnd          string = "--" //QueryComment
+	//QueryKeyword
+	QkWhere string = "\nwhere true "
+	// QkWhere  string = "\nwhere 1 "
+	QkHaving string = "\nhaving true "
+	QkOrder  string = "\norder by "
+	QkLimit  string = "\nlimit  "
+	QkOffset string = " offset "
+
+	QkTmpOrder string = " order by is_sum desc, t_id asc "
+)
+
+type AppApi struct {
+	ApiUrl    string
+	GateToken string
+}
+
+// 0:Sso, 1:Dbu  매우 중요하다.
+var gAppApis [2]AppApi
+
+var (
+	SQL_DEBUG    bool
+	NORMAL_DEBUG bool
+)
+
+var BlockNoCnt int
+
+// type GateTokenGetReq struct {
+// 	ClientId     string
+// 	BeforeBase64 string
+// 	AppBase64    string
+// }
+
+func (y *SyncController) Init() error {
+
+	vmc := &struct {
+		Driver   string
+		Host     string
+		Port     int
+		Username string
+		Database string
+		Password string
+	}{}
+
+	connStr := vmc.Username + ":" + vmc.Password + "@tcp(" + vmc.Host + ":" + e.NumToStr(vmc.Port) + ")/" + vmc.Database
+
+	fmt.Println("connStr:", connStr)
+	y.Scb.ConnString = connStr
+
+	var err error
+	if y.Db, err = xorm.NewEngine(abango.XConfig["DbType"], connStr); err != nil {
+		return e.ErrLog(e.FuncRun("309upajs3w: DBEngine Open Error ", e.CurrFuncName()), err)
+	}
+
+	var connHint string
+	strArr := strings.Split(connStr, "@tcp")
+	if len(strArr) == 2 {
+		connHint = strArr[1]
+	} else {
+		return e.ErrLog(e.FuncRun("309upajs3w: connString format mismatch: "+strArr[1], e.CurrFuncName()), err)
+	}
+
+	y.Db.ShowSQL(false)
+	y.Db.SetMaxOpenConns(100)
+	y.Db.SetMaxIdleConns(20)
+	y.Db.SetConnMaxLifetime(60 * time.Second)
+	if _, err := y.Db.IsTableExist("aaa"); err == nil {
+		e.OkLog("SyncDB connection in " + connHint)
+		return nil
+	} else {
+		return e.ErrLog(e.FuncRun("93haoy93d: SyncDB connection Fail in "+connHint+": ", e.CurrFuncName()), err)
+	}
+
+}
+
+type (
+	MemoryMap map[string]interface{}
+
+	MapStore struct {
+		store MemoryMap
+	}
+)
+
+func (c *MapStore) Get(key string) interface{} {
+	return c.store[key]
+}
+
+func (c *MapStore) Set(key string, val interface{}) {
+	if c.store == nil {
+		c.store = make(MemoryMap)
+	}
+	c.store[key] = val
+}
+
+func DbrPasswd(password string, salt string) string {
+	salt16 := DbrSaltBase(salt, 16)
+	var passwordBytes = []byte(password)
+	var sha256Hasher = sha256.New()
+
+	passwordBytes = append(passwordBytes, salt16...)
+	sha256Hasher.Write(passwordBytes)
+
+	var hashedPasswordBytes = sha256Hasher.Sum(nil)
+	var base64EncodedPasswordHash = base64.URLEncoding.EncodeToString(hashedPasswordBytes)
+
+	return base64EncodedPasswordHash
+}
+
+func DbrHashedIndex(target string) string {
+	//!!중요: salt는 16char에서만 작동된다. hash 값은 44 char나오지만 32char로 잘라서 쓴다.
+	fmt.Println("hash_full_length:", DbrPasswd(target, "$$hashed_index$$"))
+	return DbrPasswd(target, "$$hashed_index$$")[0:32]
+}
+
+func DbrCompare(hashedPassword, currPassword string, salt string) bool {
+	// fmt.Println("salt:", salt)
+	// fmt.Println("currPassword:", currPassword)
+	var currPasswordHash = DbrPasswd(currPassword, salt)
+	// fmt.Println("currPasswordHash:", currPasswordHash)
+	// fmt.Println("hashedPassword:", hashedPassword)
+	return hashedPassword == currPasswordHash
+}
+
+func DbrSaltBase(salt string, saltSize int) []byte { //어떤 사이즈라도 16byte의 Base64로 변경
+	tmp := []byte(salt)
+	salt64 := base64.StdEncoding.EncodeToString(tmp)
+	return []byte(salt64[4 : saltSize+4])
+}
+
+func HasPickActPage(uri string, table string) bool {
+	if table == "member" {
+		if uri == "/"+table+"-pick" || uri == "/"+table+"-act" || uri == "/"+table+"-page" || uri == "/"+table+"-secured-pick" || uri == "/"+table+"-secured-page" || uri == "/"+table+"-secured-act" {
+			return true
+		} else {
+			return false
+		}
+	} else {
+		if uri == "/"+table+"-pick" || uri == "/"+table+"-act" || uri == "/"+table+"-page" {
+			return true
+		} else {
+			return false
+		}
+	}
+}
+
+// func ByteIndex(ba *[]byte, bt byte, opt int) int {
+// 	if opt == 0 { //normal
+// 		for i := 0; i < len(*ba); i++ {
+// 			if (*ba)[i] == bt {
+// 				return i
+// 			}
+// 		}
+// 	} else if opt == 1 { //rerverse
+// 		for i := len(*ba) - 1; i > 0; i-- {
+// 			if (*ba)[i] == bt {
+// 				return i
+// 			}
+// 		}
+// 	}
+// 	return -1
+// }
+
+func LastQry(qry xorm.Session) string {
+	ret, _ := qry.LastSQL()
+	fmt.Println("\n" + ret + "\n")
+	return ret
+}
+
+func ShowQry(qry xorm.Session, qryName string) string {
+	if SQL_DEBUG {
+		ret, _ := qry.LastSQL()
+		return e.LogStr("", "ShowQry===["+qryName+"]==="+"\n[ "+ret+" ]\n")
+	}
+	return ""
+}
+
+func ShowSql(sqlStr string, qryName string) string {
+	if SQL_DEBUG {
+		return e.LogStr("", "ShowSql===["+qryName+"]==="+"\n[ "+sqlStr+" ]\n")
+	}
+	return ""
+}
+
+// func ShowDebug(debugStr string, index string) string {
+// 	if NORMAL_DEBUG {
+// 		return e.LogStr("", "ShowDebug===["+index+"]==="+"\n[ "+debugStr+" ]\n")
+// 	}
+// 	return ""
+// }
+
+func QryDirName(qryName string) (string, string) {
+	if !strings.Contains(qryName, "::") {
+		return "queries/", qryName
+	} else {
+		q := strings.Split(qryName, "::")
+		return "queries/themes/" + q[0] + "/", q[1]
+	}
+}
+
+func StripHtml(cont string, max int) string {
+	p := bluemonday.StripTagsPolicy()
+	s := p.Sanitize(cont)
+	if len(s) > max {
+		return string([]rune(s)[:max])
+	} else {
+		return s
+	}
+}
+
+func Sanitize(cont string) string {
+	p := bluemonday.UGCPolicy()
+	return p.Sanitize(cont)
+}
+
+func AddStrIfNotExist(s *string, target string) {
+	if !strings.Contains(*s, target) {
+		*s += target
+	}
+}
+
+func HttpResponseSimplePost(method string, apiurl string, jsBytes []byte) (retbody []byte, retsta int, reterr error) {
+
+	response, err := http.Post(apiurl, "application/json", bytes.NewBuffer(jsBytes))
+	if err != nil {
+		return nil, 0, errors.New(e.FuncRunErr("65rfg0csdew", "The HTTP request failed with error "+e.CurrFuncName()+err.Error()))
+	} else {
+		retbody, err = ioutil.ReadAll(response.Body)
+		if err != nil {
+			return nil, 0, errors.New(e.FuncRunErr("kjda89382", "ReadAll error "+e.CurrFuncName()+err.Error()))
+		}
+	}
+	return retbody, response.StatusCode, nil
+}
+
+func HttpResponseWithGt(method string, apiurl string, jsBytes []byte, gateToken string) (retbody []byte, retsta int, reterr error) {
+	reader := bytes.NewBuffer(jsBytes)
+	req, err := http.NewRequest(method, apiurl, reader)
+	if err != nil {
+		return nil, 909, e.ErrLog(e.FuncRun("xcawrq3276fa-http.NewRequest "+apiurl, e.CurrFuncName()), err)
+	}
+
+	req.Header.Add("RemoteIp", "localhost")
+	req.Header.Add("Referer", "http://localhost")
+	req.Header.Add("GateToken", gateToken)
+
+	req.Body = ioutil.NopCloser(bytes.NewReader(jsBytes))
+
+	// Client객체에서 Request 실행
+	client := &http.Client{
+		Timeout: time.Second * 20, //Otherwirse, it can cause crash without this line. Must Must.
+	} // Normal is 10 but extend 20 on 1 Dec 2018
+
+	// fmt.Println(reflect.TypeOf(respo))
+	resp, err := client.Do(req)
+	if err != nil {
+		return nil, 909, e.ErrLog(e.FuncRun("wewer2354e-client.Do "+apiurl, e.CurrFuncName()), err)
+	}
+	defer resp.Body.Close()
+
+	byteRtn, _ := ioutil.ReadAll(resp.Body)
+	return byteRtn, resp.StatusCode, nil
+}
+
+func GuestGateTokenGet(appType int, pivotUrl string, ab64 string) (string, string, error) {
+
+	if gAppApis[appType].GateToken == "" {
+		req := &struct {
+			AppType   string
+			AppBase64 string
+		}{
+			AppType:   "Main",
+			AppBase64: ab64,
+		}
+
+		bodyBytes, _ := json.Marshal(req)
+		apiUrl := pivotUrl + "/gate-token-get"
+		msgBytes, staInt, err := HttpResponseSimplePost("POST", apiUrl, bodyBytes)
+		// fmt.Println("apiUrl:", apiUrl)
+		// fmt.Println("bodyBytes:", string(bodyBytes))
+
+		if err != nil {
+			return "", "", e.ErrLog(e.FuncRun("45425fd34sd-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+		}
+
+		if staInt != 200 {
+			return "", "", errors.New(e.FuncRun("87ty344ra3-Request Fail "+string(msgBytes), e.CurrFuncName()))
+		}
+
+		ret := &struct {
+			ApiUrl    string
+			GateToken string
+		}{}
+
+		if err := json.Unmarshal(msgBytes, ret); err != nil {
+			return "", "", e.ErrLog(e.FuncRun("45425fd34sd-Json Format "+apiUrl, e.CurrFuncName()), err)
+		}
+		gAppApis[appType].ApiUrl = ret.ApiUrl
+		gAppApis[appType].GateToken = ret.GateToken
+
+	} else {
+		fmt.Println("GateToken already is in the ARRAY")
+	}
+
+	// fmt.Println("gSsoApiUrl:", gSsoApiUrl)
+	// fmt.Println("gSsoGateToken:", gSsoGateToken)
+
+	return gAppApis[appType].ApiUrl, gAppApis[appType].GateToken, nil
+}
+
+func GuestEncryptGet(code string) (string, string, error) {
+
+	appType := 1 //Dbupdate
+	req := &struct {
+		EncryptCode string
+	}{
+		EncryptCode: code,
+	}
+
+	// 0:Sso, 1:Dbu
+	pivotUrl, gateToken, err := GuestGateTokenGet(appType, abango.XConfig["DbuConnString"], abango.XConfig["DbuAppBase64"])
+	if err != nil {
+		return "", "", e.ErrLog(e.FuncRun("23rfsr3qrase", e.CurrFuncName()), err)
+	}
+
+	ret := &struct {
+		EncrypteKey string
+		SaltKey     string
+	}{}
+
+	bodyBytes, _ := json.Marshal(req)
+	apiUrl := pivotUrl + "/encrypt-get"
+	msgBytes, staInt, err := HttpResponseWithGt("POST", apiUrl, bodyBytes, gateToken)
+	if err != nil {
+		return "", "", e.ErrLog(e.FuncRun("1eadwrq34dxc-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+	}
+	if staInt != 200 {
+		gAppApis[appType].GateToken = "" // GateToke Expired 경우 Clear 한다.
+		return "", "", errors.New(e.FuncRun("45faw3rfw-Request Fail "+string(msgBytes), e.CurrFuncName()))
+	}
+
+	if err := json.Unmarshal(msgBytes, ret); err != nil {
+		return "", "", e.ErrLog(e.FuncRun("6756er345r3", e.CurrFuncName()), err)
+	}
+
+	return ret.EncrypteKey, ret.SaltKey, nil
+}
+
+func GuestAvailDbupdateGet(lastno string, isskipup string) ([]byte, error) {
+
+	appType := 1 //Dbupdate
+	req := &struct {
+		DbupdateNo   string
+		IsSkipUpdate string
+	}{
+		DbupdateNo:   lastno,
+		IsSkipUpdate: isskipup,
+	}
+
+	// 0:Sso, 1:Dbu
+	pivotUrl, gateToken, err := GuestGateTokenGet(appType, abango.XConfig["DbuConnString"], abango.XConfig["DbuAppBase64"])
+	if err != nil {
+		return nil, e.ErrLog(e.FuncRun("23rfsr3qrase", e.CurrFuncName()), err)
+	}
+
+	bodyBytes, _ := json.Marshal(req)
+	apiUrl := pivotUrl + "/avail-dbupdate-get"
+	msgBytes, staInt, err := HttpResponseWithGt("POST", apiUrl, bodyBytes, gateToken)
+	if err != nil {
+		return nil, e.ErrLog(e.FuncRun("1eadwrq34dxc-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+	}
+	if staInt != 200 {
+		gAppApis[appType].GateToken = "" // GateToke Expired 경우 Clear 한다.
+		return nil, errors.New(e.FuncRun("0asfweijcvs-Request Fail "+string(msgBytes), e.CurrFuncName()))
+	}
+	return msgBytes, nil
+}
+
+func GuestKeyPairGet(clientId string) (string, error) {
+	appType := 0 //Dbupdate
+	req := &struct {
+		ClientId string
+	}{
+		ClientId: clientId,
+	}
+	// fmt.Println("clientId:", clientId)
+	// 0:Sso, 1:Dbu
+	pivotUrl, gateToken, err := GuestGateTokenGet(appType, abango.XConfig["SsoConnString"], abango.XConfig["SsoAppBase64"])
+	if err != nil {
+		return "", e.ErrLog(e.FuncRun("23rfsr3qrase", e.CurrFuncName()), err)
+	}
+
+	ret := &struct {
+		KeyPair string
+	}{}
+
+	bodyBytes, _ := json.Marshal(req)
+	apiUrl := pivotUrl + "/key-pair-get"
+	msgBytes, staInt, err := HttpResponseWithGt("POST", apiUrl, bodyBytes, gateToken)
+	if err != nil {
+		return "", e.ErrLog(e.FuncRun("1eadwrq34dxc-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+	}
+	if staInt != 200 {
+		gAppApis[appType].GateToken = "" // GateToke Expired 경우 Clear 한다.
+		return "", errors.New(e.FuncRun("09665gsre3-Request Fail "+string(msgBytes), e.CurrFuncName()))
+	}
+
+	if err := json.Unmarshal(msgBytes, ret); err != nil {
+		return "", e.ErrLog(e.FuncRun("9074tf32de", e.CurrFuncName()), err)
+	}
+
+	return ret.KeyPair, nil
+}
+
+func OneRowQuery(y *abango.Controller, sql string) (c1 string, c2 string, c3 string, err error) {
+	page, err := y.Db.Query(sql)
+	if err != nil {
+		return "", "", "", errors.New(e.FuncRunErr("0hjnboisqow", e.CurrFuncName()+err.Error()))
+	}
+	if len(page) > 1 {
+		return "", "", "", errors.New(e.FuncRunErr("0k1dt6j3d", e.CurrFuncName()+"Row Count > 1 "))
+	}
+
+	for _, row := range page {
+		c1 = string(row["c1"])
+		c2 = string(row["c2"])
+		c3 = string(row["c3"])
+	}
+	return
+}
+
+func IsFirstOrderGet(y *abango.Controller, buyerId int) string {
+	qry := fmt.Sprintf("select count(*) as c1 from dbr_sorder where buyer_id = %d ", buyerId)
+	ordCnt, _, _, _ := OneRowQuery(y, qry)
+	if ordCnt == "1" {
+		return "1"
+	} else {
+		return "0"
+	}
+}
+
+func TimeFormatGet(format string) string {
+	rtn := ""
+	if format == "" {
+		rtn = "060102"
+	} else if format == "YYMMDD" {
+		rtn = "060102"
+	} else if format == "YYYYMMDD" {
+		rtn = "20060102"
+	} else if format == "YY-MM-DD" {
+		rtn = "06-01-02"
+	} else if format == "YY.MM.DD" {
+		rtn = "06.01.02"
+	} else if format == "YYMM" {
+		rtn = "0601"
+	} else if format == "YY" {
+		rtn = "06"
+	}
+	return rtn
+}

+ 491 - 0
locals/common-func-dev.go-

@@ -0,0 +1,491 @@
+package locals
+
+import (
+	"bytes"
+	"crypto/sha256"
+	"encoding/base64"
+	"encoding/json"
+	"errors"
+	"fmt"
+	"io/ioutil"
+	"net/http"
+	"strings"
+	"time"
+
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+	"github.com/go-xorm/xorm"
+	"github.com/microcosm-cc/bluemonday"
+)
+
+const (
+	// Tpf string = "dbr_" // TablePrefix
+	//QueryComment
+	QcWhere        string = "-- @where"
+	QcSubWhere     string = "-- @subwhere"
+	QcHaving       string = "-- @having"
+	QcOrder        string = "-- @order"
+	QcLimitOffset  string = "-- @limitoffset"
+	QcExtract      string = "-- @extract:"
+	QcClosed       string = "-- @closed:"
+	QcDelivery     string = "-- @delivery:"
+	QcBetweenDates string = "-- @between_dates"
+	QcEnd          string = "--" //QueryComment
+	//QueryKeyword
+	QkWhere string = "\nwhere true "
+	// QkWhere  string = "\nwhere 1 "
+	QkHaving string = "\nhaving true "
+	QkOrder  string = "\norder by "
+	QkLimit  string = "\nlimit  "
+	QkOffset string = " offset "
+
+	QkTmpOrder string = " order by is_sum desc, t_id asc "
+)
+
+type AppApi struct {
+	ApiUrl    string
+	GateToken string
+}
+
+// 0:Sso, 1:Dbu  매우 중요하다.
+var gAppApis [2]AppApi
+
+var (
+	SQL_DEBUG    bool
+	NORMAL_DEBUG bool
+)
+
+var BlockNoCnt int
+
+// type GateTokenGetReq struct {
+// 	ClientId     string
+// 	BeforeBase64 string
+// 	AppBase64    string
+// }
+
+func (y *SyncController) Init() error {
+
+	vmc := &struct {
+		Driver   string
+		Host     string
+		Port     int
+		Username string
+		Database string
+		Password string
+	}{}
+
+	connStr := vmc.Username + ":" + vmc.Password + "@tcp(" + vmc.Host + ":" + e.NumToStr(vmc.Port) + ")/" + vmc.Database
+
+	fmt.Println("connStr:", connStr)
+	y.Scb.ConnString = connStr
+
+	var err error
+	if y.Db, err = xorm.NewEngine(abango.XConfig["DbType"], connStr); err != nil {
+		return e.ErrLog(e.FuncRun("309upajs3w: DBEngine Open Error ", e.CurrFuncName()), err)
+	}
+
+	var connHint string
+	strArr := strings.Split(connStr, "@tcp")
+	if len(strArr) == 2 {
+		connHint = strArr[1]
+	} else {
+		return e.ErrLog(e.FuncRun("309upajs3w: connString format mismatch: "+strArr[1], e.CurrFuncName()), err)
+	}
+
+	y.Db.ShowSQL(false)
+	y.Db.SetMaxOpenConns(100)
+	y.Db.SetMaxIdleConns(20)
+	y.Db.SetConnMaxLifetime(60 * time.Second)
+	if _, err := y.Db.IsTableExist("aaa"); err == nil {
+		e.OkLog("SyncDB connection in " + connHint)
+		return nil
+	} else {
+		return e.ErrLog(e.FuncRun("93haoy93d: SyncDB connection Fail in "+connHint+": ", e.CurrFuncName()), err)
+	}
+
+}
+
+type (
+	MemoryMap map[string]interface{}
+
+	MapStore struct {
+		store MemoryMap
+	}
+)
+
+func (c *MapStore) Get(key string) interface{} {
+	return c.store[key]
+}
+
+func (c *MapStore) Set(key string, val interface{}) {
+	if c.store == nil {
+		c.store = make(MemoryMap)
+	}
+	c.store[key] = val
+}
+
+func DbrPasswd(password string, salt string) string {
+	salt16 := DbrSaltBase(salt, 16)
+	var passwordBytes = []byte(password)
+	var sha256Hasher = sha256.New()
+
+	passwordBytes = append(passwordBytes, salt16...)
+	sha256Hasher.Write(passwordBytes)
+
+	var hashedPasswordBytes = sha256Hasher.Sum(nil)
+	var base64EncodedPasswordHash = base64.URLEncoding.EncodeToString(hashedPasswordBytes)
+
+	return base64EncodedPasswordHash
+}
+
+func DbrHashedIndex(target string) string {
+	//!!중요: salt는 16char에서만 작동된다. hash 값은 44 char나오지만 32char로 잘라서 쓴다.
+	fmt.Println("hash_full_length:", DbrPasswd(target, "$$hashed_index$$"))
+	return DbrPasswd(target, "$$hashed_index$$")[0:32]
+}
+
+func DbrCompare(hashedPassword, currPassword string, salt string) bool {
+	// fmt.Println("salt:", salt)
+	// fmt.Println("currPassword:", currPassword)
+	var currPasswordHash = DbrPasswd(currPassword, salt)
+	// fmt.Println("currPasswordHash:", currPasswordHash)
+	// fmt.Println("hashedPassword:", hashedPassword)
+	return hashedPassword == currPasswordHash
+}
+
+func DbrSaltBase(salt string, saltSize int) []byte { //어떤 사이즈라도 16byte의 Base64로 변경
+	tmp := []byte(salt)
+	salt64 := base64.StdEncoding.EncodeToString(tmp)
+	return []byte(salt64[4 : saltSize+4])
+}
+
+func HasPickActPage(uri string, table string) bool {
+	if table == "member" {
+		if uri == "/"+table+"-pick" || uri == "/"+table+"-act" || uri == "/"+table+"-page" || uri == "/"+table+"-secured-pick" || uri == "/"+table+"-secured-page" || uri == "/"+table+"-secured-act" {
+			return true
+		} else {
+			return false
+		}
+	} else {
+		if uri == "/"+table+"-pick" || uri == "/"+table+"-act" || uri == "/"+table+"-page" {
+			return true
+		} else {
+			return false
+		}
+	}
+}
+
+// func ByteIndex(ba *[]byte, bt byte, opt int) int {
+// 	if opt == 0 { //normal
+// 		for i := 0; i < len(*ba); i++ {
+// 			if (*ba)[i] == bt {
+// 				return i
+// 			}
+// 		}
+// 	} else if opt == 1 { //rerverse
+// 		for i := len(*ba) - 1; i > 0; i-- {
+// 			if (*ba)[i] == bt {
+// 				return i
+// 			}
+// 		}
+// 	}
+// 	return -1
+// }
+
+func LastQry(qry xorm.Session) string {
+	ret, _ := qry.LastSQL()
+	fmt.Println("\n" + ret + "\n")
+	return ret
+}
+
+func ShowQry(qry xorm.Session, qryName string) string {
+	if SQL_DEBUG {
+		ret, _ := qry.LastSQL()
+		return e.LogStr("", "ShowQry===["+qryName+"]==="+"\n[ "+ret+" ]\n")
+	}
+	return ""
+}
+
+func ShowSql(sqlStr string, qryName string) string {
+	if SQL_DEBUG {
+		return e.LogStr("", "ShowSql===["+qryName+"]==="+"\n[ "+sqlStr+" ]\n")
+	}
+	return ""
+}
+
+// func ShowDebug(debugStr string, index string) string {
+// 	if NORMAL_DEBUG {
+// 		return e.LogStr("", "ShowDebug===["+index+"]==="+"\n[ "+debugStr+" ]\n")
+// 	}
+// 	return ""
+// }
+
+func QryDirName(qryName string) (string, string) {
+	if !strings.Contains(qryName, "::") {
+		return "queries/", qryName
+	} else {
+		q := strings.Split(qryName, "::")
+		return "queries/themes/" + q[0] + "/", q[1]
+	}
+}
+
+func StripHtml(cont string, max int) string {
+	p := bluemonday.StripTagsPolicy()
+	s := p.Sanitize(cont)
+	if len(s) > max {
+		return string([]rune(s)[:max])
+	} else {
+		return s
+	}
+}
+
+func Sanitize(cont string) string {
+	p := bluemonday.UGCPolicy()
+	return p.Sanitize(cont)
+}
+
+func AddStrIfNotExist(s *string, target string) {
+	if !strings.Contains(*s, target) {
+		*s += target
+	}
+}
+
+func HttpResponseSimplePost(method string, apiurl string, jsBytes []byte) (retbody []byte, retsta int, reterr error) {
+
+	response, err := http.Post(apiurl, "application/json", bytes.NewBuffer(jsBytes))
+	if err != nil {
+		return nil, 0, errors.New(e.FuncRunErr("65rfg0csdew", "The HTTP request failed with error "+e.CurrFuncName()+err.Error()))
+	} else {
+		retbody, err = ioutil.ReadAll(response.Body)
+		if err != nil {
+			return nil, 0, errors.New(e.FuncRunErr("kjda89382", "ReadAll error "+e.CurrFuncName()+err.Error()))
+		}
+	}
+	return retbody, response.StatusCode, nil
+}
+
+func HttpResponseWithGt(method string, apiurl string, jsBytes []byte, gateToken string) (retbody []byte, retsta int, reterr error) {
+	reader := bytes.NewBuffer(jsBytes)
+	req, err := http.NewRequest(method, apiurl, reader)
+	if err != nil {
+		return nil, 909, e.ErrLog(e.FuncRun("xcawrq3276fa-http.NewRequest "+apiurl, e.CurrFuncName()), err)
+	}
+
+	req.Header.Add("RemoteIp", "localhost")
+	req.Header.Add("Referer", "http://localhost")
+	req.Header.Add("GateToken", gateToken)
+
+	req.Body = ioutil.NopCloser(bytes.NewReader(jsBytes))
+
+	// Client객체에서 Request 실행
+	client := &http.Client{
+		Timeout: time.Second * 20, //Otherwirse, it can cause crash without this line. Must Must.
+	} // Normal is 10 but extend 20 on 1 Dec 2018
+
+	// fmt.Println(reflect.TypeOf(respo))
+	resp, err := client.Do(req)
+	if err != nil {
+		return nil, 909, e.ErrLog(e.FuncRun("wewer2354e-client.Do "+apiurl, e.CurrFuncName()), err)
+	}
+	defer resp.Body.Close()
+
+	byteRtn, _ := ioutil.ReadAll(resp.Body)
+	return byteRtn, resp.StatusCode, nil
+}
+
+func GuestGateTokenGet(appType int, pivotUrl string, ab64 string) (string, string, error) {
+
+	if gAppApis[appType].GateToken == "" {
+		req := &struct {
+			AppType   string
+			AppBase64 string
+		}{
+			AppType:   "Main",
+			AppBase64: ab64,
+		}
+
+		bodyBytes, _ := json.Marshal(req)
+		apiUrl := pivotUrl + "/gate-token-get"
+		msgBytes, staInt, err := HttpResponseSimplePost("POST", apiUrl, bodyBytes)
+		// fmt.Println("apiUrl:", apiUrl)
+		// fmt.Println("bodyBytes:", string(bodyBytes))
+
+		if err != nil {
+			return "", "", e.ErrLog(e.FuncRun("45425fd34sd-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+		}
+
+		if staInt != 200 {
+			return "", "", errors.New(e.FuncRun("87ty344ra3-Request Fail "+string(msgBytes), e.CurrFuncName()))
+		}
+
+		ret := &struct {
+			ApiUrl    string
+			GateToken string
+		}{}
+
+		if err := json.Unmarshal(msgBytes, ret); err != nil {
+			return "", "", e.ErrLog(e.FuncRun("45425fd34sd-Json Format "+apiUrl, e.CurrFuncName()), err)
+		}
+		gAppApis[appType].ApiUrl = ret.ApiUrl
+		gAppApis[appType].GateToken = ret.GateToken
+
+	} else {
+		fmt.Println("GateToken already is in the ARRAY")
+	}
+
+	// fmt.Println("gSsoApiUrl:", gSsoApiUrl)
+	// fmt.Println("gSsoGateToken:", gSsoGateToken)
+
+	return gAppApis[appType].ApiUrl, gAppApis[appType].GateToken, nil
+}
+
+func GuestEncryptGet(code string) (string, string, error) {
+
+	appType := 1 //Dbupdate
+	req := &struct {
+		EncryptCode string
+	}{
+		EncryptCode: code,
+	}
+
+	// 0:Sso, 1:Dbu
+	pivotUrl, gateToken, err := GuestGateTokenGet(appType, abango.XConfig["DbuConnString"], abango.XConfig["DbuAppBase64"])
+	if err != nil {
+		return "", "", e.ErrLog(e.FuncRun("23rfsr3qrase", e.CurrFuncName()), err)
+	}
+
+	ret := &struct {
+		EncrypteKey string
+		SaltKey     string
+	}{}
+
+	bodyBytes, _ := json.Marshal(req)
+	apiUrl := pivotUrl + "/encrypt-get"
+	msgBytes, staInt, err := HttpResponseWithGt("POST", apiUrl, bodyBytes, gateToken)
+	if err != nil {
+		return "", "", e.ErrLog(e.FuncRun("1eadwrq34dxc-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+	}
+	if staInt != 200 {
+		gAppApis[appType].GateToken = "" // GateToke Expired 경우 Clear 한다.
+		return "", "", errors.New(e.FuncRun("45faw3rfw-Request Fail "+string(msgBytes), e.CurrFuncName()))
+	}
+
+	if err := json.Unmarshal(msgBytes, ret); err != nil {
+		return "", "", e.ErrLog(e.FuncRun("6756er345r3", e.CurrFuncName()), err)
+	}
+
+	return ret.EncrypteKey, ret.SaltKey, nil
+}
+
+func GuestAvailDbupdateGet(lastno string, isskipup string) ([]byte, error) {
+
+	appType := 1 //Dbupdate
+	req := &struct {
+		DbupdateNo   string
+		IsSkipUpdate string
+	}{
+		DbupdateNo:   lastno,
+		IsSkipUpdate: isskipup,
+	}
+
+	// 0:Sso, 1:Dbu
+	pivotUrl, gateToken, err := GuestGateTokenGet(appType, abango.XConfig["DbuConnString"], abango.XConfig["DbuAppBase64"])
+	if err != nil {
+		return nil, e.ErrLog(e.FuncRun("23rfsr3qrase", e.CurrFuncName()), err)
+	}
+
+	bodyBytes, _ := json.Marshal(req)
+	apiUrl := pivotUrl + "/avail-dbupdate-get"
+	msgBytes, staInt, err := HttpResponseWithGt("POST", apiUrl, bodyBytes, gateToken)
+	if err != nil {
+		return nil, e.ErrLog(e.FuncRun("1eadwrq34dxc-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+	}
+	if staInt != 200 {
+		gAppApis[appType].GateToken = "" // GateToke Expired 경우 Clear 한다.
+		return nil, errors.New(e.FuncRun("0asfweijcvs-Request Fail "+string(msgBytes), e.CurrFuncName()))
+	}
+	return msgBytes, nil
+}
+
+func GuestKeyPairGet(clientId string) (string, error) {
+	appType := 0 //Dbupdate
+	req := &struct {
+		ClientId string
+	}{
+		ClientId: clientId,
+	}
+	// fmt.Println("clientId:", clientId)
+	// 0:Sso, 1:Dbu
+	pivotUrl, gateToken, err := GuestGateTokenGet(appType, abango.XConfig["SsoConnString"], abango.XConfig["SsoAppBase64"])
+	if err != nil {
+		return "", e.ErrLog(e.FuncRun("23rfsr3qrase", e.CurrFuncName()), err)
+	}
+
+	ret := &struct {
+		KeyPair string
+	}{}
+
+	bodyBytes, _ := json.Marshal(req)
+	apiUrl := pivotUrl + "/key-pair-get"
+	msgBytes, staInt, err := HttpResponseWithGt("POST", apiUrl, bodyBytes, gateToken)
+	if err != nil {
+		return "", e.ErrLog(e.FuncRun("1eadwrq34dxc-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+	}
+	if staInt != 200 {
+		gAppApis[appType].GateToken = "" // GateToke Expired 경우 Clear 한다.
+		return "", errors.New(e.FuncRun("09665gsre3-Request Fail "+string(msgBytes), e.CurrFuncName()))
+	}
+
+	if err := json.Unmarshal(msgBytes, ret); err != nil {
+		return "", e.ErrLog(e.FuncRun("9074tf32de", e.CurrFuncName()), err)
+	}
+
+	return ret.KeyPair, nil
+}
+
+func OneRowQuery(y *abango.Controller, sql string) (c1 string, c2 string, c3 string, err error) {
+	page, err := y.Db.Query(sql)
+	if err != nil {
+		return "", "", "", errors.New(e.FuncRunErr("0hjnboisqow", e.CurrFuncName()+err.Error()))
+	}
+	if len(page) > 1 {
+		return "", "", "", errors.New(e.FuncRunErr("0k1dt6j3d", e.CurrFuncName()+"Row Count > 1 "))
+	}
+
+	for _, row := range page {
+		c1 = string(row["c1"])
+		c2 = string(row["c2"])
+		c3 = string(row["c3"])
+	}
+	return
+}
+
+func IsFirstOrderGet(y *abango.Controller, buyerId int) string {
+	qry := fmt.Sprintf("select count(*) as c1 from dbr_sorder where buyer_id = %d ", buyerId)
+	ordCnt, _, _, _ := OneRowQuery(y, qry)
+	if ordCnt == "1" {
+		return "1"
+	} else {
+		return "0"
+	}
+}
+
+func TimeFormatGet(format string) string {
+	rtn := ""
+	if format == "" {
+		rtn = "060102"
+	} else if format == "YYMMDD" {
+		rtn = "060102"
+	} else if format == "YYYYMMDD" {
+		rtn = "20060102"
+	} else if format == "YY-MM-DD" {
+		rtn = "06-01-02"
+	} else if format == "YY.MM.DD" {
+		rtn = "06.01.02"
+	} else if format == "YYMM" {
+		rtn = "0601"
+	} else if format == "YY" {
+		rtn = "06"
+	}
+	return rtn
+}

+ 533 - 0
locals/common-func.go

@@ -0,0 +1,533 @@
+//go:build !dev
+// +build !dev
+
+package locals
+
+import (
+	"bytes"
+	"crypto/sha256"
+	"encoding/base64"
+	"encoding/json"
+	"errors"
+	"fmt"
+	"io/ioutil"
+	"kkscrap-go/locals/gosodium/cryptobox"
+	"net/http"
+	"strings"
+	"time"
+
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+	"github.com/go-xorm/xorm"
+	"github.com/microcosm-cc/bluemonday"
+)
+
+const (
+	// Tpf string = "dbr_" // TablePrefix
+	//QueryComment
+	QcWhere        string = "-- @where"
+	QcSubWhere     string = "-- @subwhere"
+	QcHaving       string = "-- @having"
+	QcOrder        string = "-- @order"
+	QcLimitOffset  string = "-- @limitoffset"
+	QcExtract      string = "-- @extract:"
+	QcClosed       string = "-- @closed:"
+	QcDelivery     string = "-- @delivery:"
+	QcBetweenDates string = "-- @between_dates"
+	QcEnd          string = "--" //QueryComment
+	//QueryKeyword
+	QkWhere string = "\nwhere true "
+	// QkWhere  string = "\nwhere 1 "
+	QkHaving string = "\nhaving true "
+	QkOrder  string = "\norder by "
+	QkLimit  string = "\nlimit  "
+	QkOffset string = " offset "
+
+	QkTmpOrder string = " order by is_sum desc, t_id asc "
+)
+
+type AppApi struct {
+	ApiUrl    string
+	GateToken string
+}
+
+// 0:Sso, 1:Dbu  매우 중요하다.
+var gAppApis [2]AppApi
+
+var (
+	SQL_DEBUG    bool
+	NORMAL_DEBUG bool
+)
+
+var BlockNoCnt int
+
+// type GateTokenGetReq struct {
+// 	ClientId     string
+// 	BeforeBase64 string
+// 	AppBase64    string
+// }
+
+func (y *SyncController) Init() error {
+
+	var kPairStr string
+	if abango.XConfig["IsLocalKeyPair"] != "Yes" {
+		keypair, err := GuestKeyPairGet(abango.XConfig["SyncClientId"])
+		if err != nil {
+			return e.ErrLog(e.FuncRun("03joau0u3qd", e.CurrFuncName()), err)
+		}
+		kPairStr = keypair
+		fmt.Println("RemoteKeypair:", kPairStr)
+
+	} else {
+		kPairStr = abango.XConfig["LocalKeyPair"]
+		fmt.Println("LocalKeyPair:", kPairStr)
+	}
+
+	keyPair, err := base64.StdEncoding.DecodeString(kPairStr)
+	if err != nil {
+		return e.ErrLog(e.FuncRun("joiuejcsoe: Decryption Failure-1 ", e.CurrFuncName()), err)
+	}
+
+	sKey, pKey, err := cryptobox.CryptoBoxGetSecretPublicKeyFrom(keyPair)
+	if err != nil {
+		return e.ErrLog(e.FuncRun("joiuejcsoe: Decryption Failure-2 ", e.CurrFuncName()), err)
+	}
+
+	decodedBytes, err := base64.StdEncoding.DecodeString(abango.XConfig["SyncBB64"])
+	if err != nil {
+		return e.ErrLog(e.FuncRun("joiuejcsoe: Decryption Failure-3 ", e.CurrFuncName()), err)
+	}
+
+	//decrypt 문제는 여기서 memory error 가 난다.
+	decryptedBytes, boxRet := cryptobox.CryptoBoxSealOpen(decodedBytes, pKey, sKey)
+	if boxRet != 0 {
+		return e.ErrLog(e.FuncRun("joiuejcsoe: Decryption Failure-4(Wrong BB64Key) ", e.CurrFuncName()), err)
+	}
+
+	vmc := &struct {
+		Driver   string
+		Host     string
+		Port     int
+		Username string
+		Database string
+		Password string
+	}{}
+
+	if err := json.Unmarshal(decryptedBytes, vmc); err != nil {
+		return e.ErrLog(e.FuncRun("joiuejcsoe: Decryption Failure-5 ", e.CurrFuncName()), err)
+	}
+
+	connStr := vmc.Username + ":" + vmc.Password + "@tcp(" + vmc.Host + ":" + e.NumToStr(vmc.Port) + ")/" + vmc.Database
+
+	fmt.Println("connStr:", connStr)
+	y.Scb.ConnString = connStr
+
+	if y.Db, err = xorm.NewEngine(abango.XConfig["DbType"], connStr); err != nil {
+		return e.ErrLog(e.FuncRun("309upajs3w: DBEngine Open Error ", e.CurrFuncName()), err)
+	}
+
+	var connHint string
+	strArr := strings.Split(connStr, "@tcp")
+	if len(strArr) == 2 {
+		connHint = strArr[1]
+	} else {
+		return e.ErrLog(e.FuncRun("309upajs3w: connString format mismatch: "+strArr[1], e.CurrFuncName()), err)
+	}
+
+	y.Db.ShowSQL(false)
+	y.Db.SetMaxOpenConns(100)
+	y.Db.SetMaxIdleConns(20)
+	y.Db.SetConnMaxLifetime(60 * time.Second)
+	if _, err := y.Db.IsTableExist("aaa"); err == nil {
+		e.OkLog("SyncDB connection in " + connHint)
+		return nil
+	} else {
+		return e.ErrLog(e.FuncRun("93haoy93d: SyncDB connection Fail in "+connHint+": ", e.CurrFuncName()), err)
+	}
+
+}
+
+type (
+	MemoryMap map[string]interface{}
+
+	MapStore struct {
+		store MemoryMap
+	}
+)
+
+func (c *MapStore) Get(key string) interface{} {
+	return c.store[key]
+}
+
+func (c *MapStore) Set(key string, val interface{}) {
+	if c.store == nil {
+		c.store = make(MemoryMap)
+	}
+	c.store[key] = val
+}
+
+func DbrPasswd(password string, salt string) string {
+	salt16 := DbrSaltBase(salt, 16)
+	var passwordBytes = []byte(password)
+	var sha256Hasher = sha256.New()
+
+	passwordBytes = append(passwordBytes, salt16...)
+	sha256Hasher.Write(passwordBytes)
+
+	var hashedPasswordBytes = sha256Hasher.Sum(nil)
+	var base64EncodedPasswordHash = base64.URLEncoding.EncodeToString(hashedPasswordBytes)
+
+	return base64EncodedPasswordHash
+}
+
+func DbrHashedIndex(target string) string {
+	//!!중요: salt는 16char에서만 작동된다. hash 값은 44 char나오지만 32char로 잘라서 쓴다.
+	fmt.Println("hash_full_length:", DbrPasswd(target, "$$hashed_index$$"))
+	return DbrPasswd(target, "$$hashed_index$$")[0:32]
+}
+
+func DbrCompare(hashedPassword, currPassword string, salt string) bool {
+	// fmt.Println("salt:", salt)
+	// fmt.Println("currPassword:", currPassword)
+	var currPasswordHash = DbrPasswd(currPassword, salt)
+	// fmt.Println("currPasswordHash:", currPasswordHash)
+	// fmt.Println("hashedPassword:", hashedPassword)
+	return hashedPassword == currPasswordHash
+}
+
+func DbrSaltBase(salt string, saltSize int) []byte { //어떤 사이즈라도 16byte의 Base64로 변경
+	tmp := []byte(salt)
+	salt64 := base64.StdEncoding.EncodeToString(tmp)
+	return []byte(salt64[4 : saltSize+4])
+}
+
+func HasPickActPage(uri string, table string) bool {
+	if table == "member" {
+		if uri == "/"+table+"-pick" || uri == "/"+table+"-act" || uri == "/"+table+"-page" || uri == "/"+table+"-secured-pick" || uri == "/"+table+"-secured-page" || uri == "/"+table+"-secured-act" {
+			return true
+		} else {
+			return false
+		}
+	} else {
+		if uri == "/"+table+"-pick" || uri == "/"+table+"-act" || uri == "/"+table+"-page" {
+			return true
+		} else {
+			return false
+		}
+	}
+}
+
+// func ByteIndex(ba *[]byte, bt byte, opt int) int {
+// 	if opt == 0 { //normal
+// 		for i := 0; i < len(*ba); i++ {
+// 			if (*ba)[i] == bt {
+// 				return i
+// 			}
+// 		}
+// 	} else if opt == 1 { //rerverse
+// 		for i := len(*ba) - 1; i > 0; i-- {
+// 			if (*ba)[i] == bt {
+// 				return i
+// 			}
+// 		}
+// 	}
+// 	return -1
+// }
+
+func LastQry(qry xorm.Session) string {
+	ret, _ := qry.LastSQL()
+	fmt.Println("\n" + ret + "\n")
+	return ret
+}
+
+func ShowQry(qry xorm.Session, qryName string) string {
+	if SQL_DEBUG {
+		ret, _ := qry.LastSQL()
+		return e.LogStr("", "ShowQry===["+qryName+"]==="+"\n[ "+ret+" ]\n")
+	}
+	return ""
+}
+
+func ShowSql(sqlStr string, qryName string) string {
+	if SQL_DEBUG {
+		return e.LogStr("", "ShowSql===["+qryName+"]==="+"\n[ "+sqlStr+" ]\n")
+	}
+	return ""
+}
+
+// func ShowDebug(debugStr string, index string) string {
+// 	if NORMAL_DEBUG {
+// 		return e.LogStr("", "ShowDebug===["+index+"]==="+"\n[ "+debugStr+" ]\n")
+// 	}
+// 	return ""
+// }
+
+func QryDirName(qryName string) (string, string) {
+	if !strings.Contains(qryName, "::") {
+		return "queries/", qryName
+	} else {
+		q := strings.Split(qryName, "::")
+		return "queries/themes/" + q[0] + "/", q[1]
+	}
+}
+
+func StripHtml(cont string, max int) string {
+	p := bluemonday.StripTagsPolicy()
+	s := p.Sanitize(cont)
+	if len(s) > max {
+		return string([]rune(s)[:max])
+	} else {
+		return s
+	}
+}
+
+func Sanitize(cont string) string {
+	p := bluemonday.UGCPolicy()
+	return p.Sanitize(cont)
+}
+
+func AddStrIfNotExist(s *string, target string) {
+	if !strings.Contains(*s, target) {
+		*s += target
+	}
+}
+
+func HttpResponseSimplePost(method string, apiurl string, jsBytes []byte) (retbody []byte, retsta int, reterr error) {
+
+	response, err := http.Post(apiurl, "application/json", bytes.NewBuffer(jsBytes))
+	if err != nil {
+		return nil, 0, errors.New(e.FuncRunErr("65rfg0csdew", "The HTTP request failed with error "+e.CurrFuncName()+err.Error()))
+	} else {
+		retbody, err = ioutil.ReadAll(response.Body)
+		if err != nil {
+			return nil, 0, errors.New(e.FuncRunErr("kjda89382", "ReadAll error "+e.CurrFuncName()+err.Error()))
+		}
+	}
+	return retbody, response.StatusCode, nil
+}
+
+func HttpResponseWithGt(method string, apiurl string, jsBytes []byte, gateToken string) (retbody []byte, retsta int, reterr error) {
+	reader := bytes.NewBuffer(jsBytes)
+	req, err := http.NewRequest(method, apiurl, reader)
+	if err != nil {
+		return nil, 909, e.ErrLog(e.FuncRun("xcawrq3276fa-http.NewRequest "+apiurl, e.CurrFuncName()), err)
+	}
+
+	req.Header.Add("RemoteIp", "localhost")
+	req.Header.Add("Referer", "http://localhost")
+	req.Header.Add("GateToken", gateToken)
+
+	req.Body = ioutil.NopCloser(bytes.NewReader(jsBytes))
+
+	// Client객체에서 Request 실행
+	client := &http.Client{
+		Timeout: time.Second * 20, //Otherwirse, it can cause crash without this line. Must Must.
+	} // Normal is 10 but extend 20 on 1 Dec 2018
+
+	// fmt.Println(reflect.TypeOf(respo))
+	resp, err := client.Do(req)
+	if err != nil {
+		return nil, 909, e.ErrLog(e.FuncRun("wewer2354e-client.Do "+apiurl, e.CurrFuncName()), err)
+	}
+	defer resp.Body.Close()
+
+	byteRtn, _ := ioutil.ReadAll(resp.Body)
+	return byteRtn, resp.StatusCode, nil
+}
+
+func GuestGateTokenGet(appType int, pivotUrl string, ab64 string) (string, string, error) {
+
+	if gAppApis[appType].GateToken == "" {
+		req := &struct {
+			AppType   string
+			AppBase64 string
+		}{
+			AppType:   "Main",
+			AppBase64: ab64,
+		}
+
+		bodyBytes, _ := json.Marshal(req)
+		apiUrl := pivotUrl + "/gate-token-get"
+		msgBytes, staInt, err := HttpResponseSimplePost("POST", apiUrl, bodyBytes)
+		// fmt.Println("apiUrl:", apiUrl)
+		// fmt.Println("bodyBytes:", string(bodyBytes))
+
+		if err != nil {
+			return "", "", e.ErrLog(e.FuncRun("45425fd34sd-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+		}
+
+		if staInt != 200 {
+			return "", "", errors.New(e.FuncRun("87ty344ra3-Request Fail "+string(msgBytes), e.CurrFuncName()))
+		}
+
+		ret := &struct {
+			ApiUrl    string
+			GateToken string
+		}{}
+
+		if err := json.Unmarshal(msgBytes, ret); err != nil {
+			return "", "", e.ErrLog(e.FuncRun("45425fd34sd-Json Format "+apiUrl, e.CurrFuncName()), err)
+		}
+		gAppApis[appType].ApiUrl = ret.ApiUrl
+		gAppApis[appType].GateToken = ret.GateToken
+
+	} else {
+		fmt.Println("GateToken already is in the ARRAY")
+	}
+
+	// fmt.Println("gSsoApiUrl:", gSsoApiUrl)
+	// fmt.Println("gSsoGateToken:", gSsoGateToken)
+
+	return gAppApis[appType].ApiUrl, gAppApis[appType].GateToken, nil
+}
+
+func GuestEncryptGet(code string) (string, string, error) {
+
+	appType := 1 //Dbupdate
+	req := &struct {
+		EncryptCode string
+	}{
+		EncryptCode: code,
+	}
+
+	// 0:Sso, 1:Dbu
+	pivotUrl, gateToken, err := GuestGateTokenGet(appType, abango.XConfig["DbuConnString"], abango.XConfig["DbuAppBase64"])
+	if err != nil {
+		return "", "", e.ErrLog(e.FuncRun("23rfsr3qrase", e.CurrFuncName()), err)
+	}
+
+	ret := &struct {
+		EncrypteKey string
+		SaltKey     string
+	}{}
+
+	bodyBytes, _ := json.Marshal(req)
+	apiUrl := pivotUrl + "/encrypt-get"
+	msgBytes, staInt, err := HttpResponseWithGt("POST", apiUrl, bodyBytes, gateToken)
+	if err != nil {
+		return "", "", e.ErrLog(e.FuncRun("1eadwrq34dxc-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+	}
+	if staInt != 200 {
+		gAppApis[appType].GateToken = "" // GateToke Expired 경우 Clear 한다.
+		return "", "", errors.New(e.FuncRun("45faw3rfw-Request Fail "+string(msgBytes), e.CurrFuncName()))
+	}
+
+	if err := json.Unmarshal(msgBytes, ret); err != nil {
+		return "", "", e.ErrLog(e.FuncRun("6756er345r3", e.CurrFuncName()), err)
+	}
+
+	return ret.EncrypteKey, ret.SaltKey, nil
+}
+
+func GuestAvailDbupdateGet(lastno string, isskipup string) ([]byte, error) {
+
+	appType := 1 //Dbupdate
+	req := &struct {
+		DbupdateNo   string
+		IsSkipUpdate string
+	}{
+		DbupdateNo:   lastno,
+		IsSkipUpdate: isskipup,
+	}
+
+	// 0:Sso, 1:Dbu
+	pivotUrl, gateToken, err := GuestGateTokenGet(appType, abango.XConfig["DbuConnString"], abango.XConfig["DbuAppBase64"])
+	if err != nil {
+		return nil, e.ErrLog(e.FuncRun("23rfsr3qrase", e.CurrFuncName()), err)
+	}
+
+	bodyBytes, _ := json.Marshal(req)
+	apiUrl := pivotUrl + "/avail-dbupdate-get"
+	msgBytes, staInt, err := HttpResponseWithGt("POST", apiUrl, bodyBytes, gateToken)
+	if err != nil {
+		return nil, e.ErrLog(e.FuncRun("1eadwrq34dxc-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+	}
+	if staInt != 200 {
+		gAppApis[appType].GateToken = "" // GateToke Expired 경우 Clear 한다.
+		return nil, errors.New(e.FuncRun("0asfweijcvs-Request Fail "+string(msgBytes), e.CurrFuncName()))
+	}
+	return msgBytes, nil
+}
+
+func GuestKeyPairGet(clientId string) (string, error) {
+	appType := 0 //Dbupdate
+	req := &struct {
+		ClientId string
+	}{
+		ClientId: clientId,
+	}
+	// fmt.Println("clientId:", clientId)
+	// 0:Sso, 1:Dbu
+	pivotUrl, gateToken, err := GuestGateTokenGet(appType, abango.XConfig["SsoConnString"], abango.XConfig["SsoAppBase64"])
+	if err != nil {
+		return "", e.ErrLog(e.FuncRun("23rfsr3qrase", e.CurrFuncName()), err)
+	}
+
+	ret := &struct {
+		KeyPair string
+	}{}
+
+	bodyBytes, _ := json.Marshal(req)
+	apiUrl := pivotUrl + "/key-pair-get"
+	msgBytes, staInt, err := HttpResponseWithGt("POST", apiUrl, bodyBytes, gateToken)
+	if err != nil {
+		return "", e.ErrLog(e.FuncRun("1eadwrq34dxc-The HTTP request "+apiUrl, e.CurrFuncName()), err)
+	}
+	if staInt != 200 {
+		gAppApis[appType].GateToken = "" // GateToke Expired 경우 Clear 한다.
+		return "", errors.New(e.FuncRun("09665gsre3-Request Fail "+string(msgBytes), e.CurrFuncName()))
+	}
+
+	if err := json.Unmarshal(msgBytes, ret); err != nil {
+		return "", e.ErrLog(e.FuncRun("9074tf32de", e.CurrFuncName()), err)
+	}
+
+	return ret.KeyPair, nil
+}
+
+func OneRowQuery(y *abango.Controller, sql string) (c1 string, c2 string, c3 string, err error) {
+	page, err := y.Db.Query(sql)
+	if err != nil {
+		return "", "", "", errors.New(e.FuncRunErr("0hjnboisqow", e.CurrFuncName()+err.Error()))
+	}
+	if len(page) > 1 {
+		return "", "", "", errors.New(e.FuncRunErr("0k1dt6j3d", e.CurrFuncName()+"Row Count > 1 "))
+	}
+
+	for _, row := range page {
+		c1 = string(row["c1"])
+		c2 = string(row["c2"])
+		c3 = string(row["c3"])
+	}
+	return
+}
+
+func IsFirstOrderGet(y *abango.Controller, buyerId int) string {
+	qry := fmt.Sprintf("select count(*) as c1 from dbr_sorder where buyer_id = %d ", buyerId)
+	ordCnt, _, _, _ := OneRowQuery(y, qry)
+	if ordCnt == "1" {
+		return "1"
+	} else {
+		return "0"
+	}
+}
+
+func TimeFormatGet(format string) string {
+	rtn := ""
+	if format == "" {
+		rtn = "060102"
+	} else if format == "YYMMDD" {
+		rtn = "060102"
+	} else if format == "YYYYMMDD" {
+		rtn = "20060102"
+	} else if format == "YY-MM-DD" {
+		rtn = "06-01-02"
+	} else if format == "YY.MM.DD" {
+		rtn = "06.01.02"
+	} else if format == "YYMM" {
+		rtn = "0601"
+	} else if format == "YY" {
+		rtn = "06"
+	}
+	return rtn
+}

+ 153 - 0
locals/gosodium/cryptobox/crypto_box.go

@@ -0,0 +1,153 @@
+//go:build !dev
+// +build !dev
+
+package cryptobox
+
+// #cgo pkg-config: libsodium
+// #include <stdlib.h>
+// #include <sodium.h>
+import "C"
+import (
+	"errors"
+	support "kkscrap-go/locals/gosodium/support"
+)
+
+func CryptoBoxSeedBytes() int {
+	return int(C.crypto_box_seedbytes())
+}
+
+func CryptoBoxPublicKeyBytes() int {
+	return int(C.crypto_box_publickeybytes())
+}
+
+func CryptoBoxSecretKeyBytes() int {
+	return int(C.crypto_box_secretkeybytes())
+}
+
+func CryptoBoxNonceBytes() int {
+	return int(C.crypto_box_noncebytes())
+}
+
+func CryptoBoxMacBytes() int {
+	return int(C.crypto_box_macbytes())
+}
+
+func CryptoBoxPrimitive() string {
+	return C.GoString(C.crypto_box_primitive())
+}
+
+func CryptoBoxBeforeNmBytes() int {
+	return int(C.crypto_box_beforenmbytes())
+}
+
+func CryptoBoxZeroBytes() int {
+	return int(C.crypto_box_zerobytes())
+}
+
+func CryptoBoxBoxZeroBytes() int {
+	return int(C.crypto_box_boxzerobytes())
+}
+
+func CryptoBoxSeedKeyPair(seed []byte) ([]byte, []byte, int) {
+	support.CheckSize(seed, CryptoBoxSeedBytes(), "seed")
+	sk := make([]byte, CryptoBoxSecretKeyBytes())
+	pk := make([]byte, CryptoBoxPublicKeyBytes())
+	exit := int(C.crypto_box_seed_keypair(
+		(*C.uchar)(&pk[0]),
+		(*C.uchar)(&sk[0]),
+		(*C.uchar)(&seed[0])))
+
+	return sk, pk, exit
+}
+
+func CryptoBoxKeyPair() ([]byte, []byte, int) {
+	sk := make([]byte, CryptoBoxSecretKeyBytes())
+	pk := make([]byte, CryptoBoxPublicKeyBytes())
+	exit := int(C.crypto_box_keypair(
+		(*C.uchar)(&pk[0]),
+		(*C.uchar)(&sk[0])))
+
+	return sk, pk, exit
+}
+
+func CryptoBoxBeforeNm(pk []byte, sk []byte) ([]byte, int) {
+	support.CheckSize(pk, CryptoBoxPublicKeyBytes(), "public key")
+	support.CheckSize(sk, CryptoBoxSecretKeyBytes(), "sender's secret key")
+	k := make([]byte, CryptoBoxBeforeNmBytes())
+	exit := int(C.crypto_box_beforenm(
+		(*C.uchar)(&k[0]),
+		(*C.uchar)(&pk[0]),
+		(*C.uchar)(&sk[0])))
+
+	return k, exit
+}
+
+func CryptoBox(m []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(pk, CryptoBoxPublicKeyBytes(), "public key")
+	support.CheckSize(sk, CryptoBoxSecretKeyBytes(), "sender's secret key")
+	c := make([]byte, len(m))
+	exit := int(C.crypto_box(
+		(*C.uchar)(&c[0]),
+		(*C.uchar)(&m[0]),
+		(C.ulonglong)(len(m)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&pk[0]),
+		(*C.uchar)(&sk[0])))
+
+	return c, exit
+}
+
+func CryptoBoxOpen(c []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(pk, CryptoBoxPublicKeyBytes(), "public key")
+	support.CheckSize(sk, CryptoBoxPublicKeyBytes(), "secret key")
+	m := make([]byte, len(c))
+	exit := int(C.crypto_box_open(
+		(*C.uchar)(&m[0]),
+		(*C.uchar)(&c[0]),
+		(C.ulonglong)(len(c)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&pk[0]),
+		(*C.uchar)(&sk[0])))
+
+	return m, exit
+}
+
+func CryptoBoxAfterNm(m []byte, n []byte, k []byte) ([]byte, int) {
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(k, CryptoBoxBeforeNmBytes(), "shared secret key")
+	c := make([]byte, len(m))
+	exit := int(C.crypto_box_afternm(
+		(*C.uchar)(&c[0]),
+		(*C.uchar)(&m[0]),
+		(C.ulonglong)(len(m)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&k[0])))
+
+	return c, exit
+}
+
+func CryptoBoxOpenAfterNm(c []byte, n []byte, k []byte) ([]byte, int) {
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(k, CryptoBoxBeforeNmBytes(), "shared secret key")
+	m := make([]byte, len(c))
+	exit := int(C.crypto_box_open_afternm(
+		(*C.uchar)(&m[0]),
+		(*C.uchar)(&c[0]),
+		(C.ulonglong)(len(c)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&k[0])))
+
+	return m, exit
+}
+
+func CryptoBoxGetSecretPublicKeyFrom(keypair []byte) (sk, pk []byte, err error) {
+	if len(keypair) != 64 {
+		err = errors.New("keypair length must be 64")
+		return
+	}
+	sk = keypair[:32]
+	pk = keypair[32:]
+	return
+}

+ 72 - 0
locals/gosodium/cryptobox/crypto_box_dev.go

@@ -0,0 +1,72 @@
+//go:build dev
+// +build dev
+
+package cryptobox
+
+func CryptoBoxSeedBytes() int {
+	return 0
+}
+
+func CryptoBoxPublicKeyBytes() int {
+	return 0
+}
+
+func CryptoBoxSecretKeyBytes() int {
+	return 0
+}
+
+func CryptoBoxNonceBytes() int {
+	return 0
+}
+
+func CryptoBoxMacBytes() int {
+	return 0
+}
+
+func CryptoBoxPrimitive() string {
+	return ""
+}
+
+func CryptoBoxBeforeNmBytes() int {
+	return 0
+}
+
+func CryptoBoxZeroBytes() int {
+	return 0
+}
+
+func CryptoBoxBoxZeroBytes() int {
+	return 0
+}
+
+func CryptoBoxSeedKeyPair(seed []byte) ([]byte, []byte, int) {
+	return nil, nil, 0
+}
+
+func CryptoBoxKeyPair() ([]byte, []byte, int) {
+	return nil, nil, 0
+}
+
+func CryptoBoxBeforeNm(pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBox(m []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpen(c []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxAfterNm(m []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpenAfterNm(c []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxGetSecretPublicKeyFrom(keypair []byte) (sk, pk []byte, err error) {
+	return
+}

+ 69 - 0
locals/gosodium/cryptobox/crypto_box_dev.go-

@@ -0,0 +1,69 @@
+package cryptobox
+
+func CryptoBoxSeedBytes() int {
+	return 0
+}
+
+func CryptoBoxPublicKeyBytes() int {
+	return 0
+}
+
+func CryptoBoxSecretKeyBytes() int {
+	return 0
+}
+
+func CryptoBoxNonceBytes() int {
+	return 0
+}
+
+func CryptoBoxMacBytes() int {
+	return 0
+}
+
+func CryptoBoxPrimitive() string {
+	return ""
+}
+
+func CryptoBoxBeforeNmBytes() int {
+	return 0
+}
+
+func CryptoBoxZeroBytes() int {
+	return 0
+}
+
+func CryptoBoxBoxZeroBytes() int {
+	return 0
+}
+
+func CryptoBoxSeedKeyPair(seed []byte) ([]byte, []byte, int) {
+	return nil, nil, 0
+}
+
+func CryptoBoxKeyPair() ([]byte, []byte, int) {
+	return nil, nil, 0
+}
+
+func CryptoBoxBeforeNm(pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBox(m []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpen(c []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxAfterNm(m []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpenAfterNm(c []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxGetSecretPublicKeyFrom(keypair []byte) (sk, pk []byte, err error) {
+	return
+}

+ 138 - 0
locals/gosodium/cryptobox/crypto_box_easy.go

@@ -0,0 +1,138 @@
+//go:build !dev
+// +build !dev
+
+package cryptobox
+
+// #cgo pkg-config: libsodium
+// #include <stdlib.h>
+// #include <sodium.h>
+import "C"
+import support "kkscrap-go/locals/gosodium/support"
+
+func CryptoBoxDetachedAfterNm(mac []byte, m []byte, n []byte, k []byte) ([]byte, int) {
+	support.CheckSize(mac, CryptoBoxMacBytes(), "mac")
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(k, CryptoBoxBeforeNmBytes(), "shared secret key")
+	c := make([]byte, len(m)+CryptoBoxMacBytes())
+	exit := int(C.crypto_box_detached_afternm(
+		(*C.uchar)(&c[0]),
+		(*C.uchar)(&mac[0]),
+		(*C.uchar)(&m[0]),
+		(C.ulonglong)(len(m)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&k[0])))
+
+	return c, exit
+}
+
+func CryptoBoxDetached(mac []byte, m []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	support.CheckSize(mac, CryptoBoxMacBytes(), "mac")
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(pk, CryptoBoxPublicKeyBytes(), "public key")
+	support.CheckSize(sk, CryptoBoxSecretKeyBytes(), "sender's secret key")
+	c := make([]byte, len(m)+CryptoBoxMacBytes())
+	exit := int(C.crypto_box_detached(
+		(*C.uchar)(&c[0]),
+		(*C.uchar)(&mac[0]),
+		(*C.uchar)(&m[0]),
+		(C.ulonglong)(len(m)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&pk[0]),
+		(*C.uchar)(&sk[0])))
+
+	return c, exit
+}
+
+func CryptoBoxEasyAfterNm(m []byte, n []byte, k []byte) ([]byte, int) {
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(k, CryptoBoxBeforeNmBytes(), "shared secret key")
+	c := make([]byte, len(m)+CryptoBoxMacBytes())
+	exit := int(C.crypto_box_easy_afternm(
+		(*C.uchar)(&c[0]),
+		(*C.uchar)(&m[0]),
+		(C.ulonglong)(len(m)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&k[0])))
+
+	return c, exit
+}
+
+func CryptoBoxEasy(m []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(pk, CryptoBoxPublicKeyBytes(), "public key")
+	support.CheckSize(sk, CryptoBoxSecretKeyBytes(), "secret key")
+	c := make([]byte, len(m)+CryptoBoxMacBytes())
+	exit := int(C.crypto_box_easy(
+		(*C.uchar)(&c[0]),
+		(*C.uchar)(&m[0]),
+		(C.ulonglong)(len(m)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&pk[0]),
+		(*C.uchar)(&sk[0])))
+
+	return c, exit
+}
+
+func CryptoBoxOpenDetachedAfterNm(c []byte, mac []byte, n []byte, k []byte) ([]byte, int) {
+	support.CheckSize(mac, CryptoBoxMacBytes(), "mac")
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(k, CryptoBoxBeforeNmBytes(), "shared secret key")
+	m := make([]byte, len(c)-CryptoBoxMacBytes())
+	exit := int(C.crypto_box_open_detached_afternm(
+		(*C.uchar)(&m[0]),
+		(*C.uchar)(&c[0]),
+		(*C.uchar)(&mac[0]),
+		(C.ulonglong)(len(c)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&k[0])))
+
+	return m, exit
+}
+
+func CryptoBoxOpenDetached(c []byte, mac []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	support.CheckSize(mac, CryptoBoxMacBytes(), "mac")
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(pk, CryptoBoxPublicKeyBytes(), "public key")
+	support.CheckSize(sk, CryptoBoxSecretKeyBytes(), "secret key")
+	m := make([]byte, len(c)-CryptoBoxMacBytes())
+	exit := int(C.crypto_box_open_detached(
+		(*C.uchar)(&m[0]),
+		(*C.uchar)(&c[0]),
+		(*C.uchar)(&mac[0]),
+		(C.ulonglong)(len(c)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&pk[0]),
+		(*C.uchar)(&sk[0])))
+
+	return m, exit
+}
+
+func CryptoBoxOpenEasyAfterNm(c []byte, n []byte, k []byte) ([]byte, int) {
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(k, CryptoBoxBeforeNmBytes(), "shared secret key")
+	m := make([]byte, len(c)-CryptoBoxMacBytes())
+	exit := int(C.crypto_box_open_easy_afternm(
+		(*C.uchar)(&m[0]),
+		(*C.uchar)(&c[0]),
+		(C.ulonglong)(len(c)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&k[0])))
+
+	return m, exit
+}
+
+func CryptoBoxOpenEasy(c []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	support.CheckSize(n, CryptoBoxNonceBytes(), "nonce")
+	support.CheckSize(pk, CryptoBoxPublicKeyBytes(), "public key")
+	support.CheckSize(sk, CryptoBoxSecretKeyBytes(), "secret key")
+	m := make([]byte, len(c)-CryptoBoxMacBytes())
+	exit := int(C.crypto_box_open_easy(
+		(*C.uchar)(&m[0]),
+		(*C.uchar)(&c[0]),
+		(C.ulonglong)(len(c)),
+		(*C.uchar)(&n[0]),
+		(*C.uchar)(&pk[0]),
+		(*C.uchar)(&sk[0])))
+
+	return m, exit
+}

+ 36 - 0
locals/gosodium/cryptobox/crypto_box_easy_dev.go

@@ -0,0 +1,36 @@
+//go:build dev
+// +build dev
+
+package cryptobox
+
+func CryptoBoxDetachedAfterNm(mac []byte, m []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxDetached(mac []byte, m []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxEasyAfterNm(m []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxEasy(m []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpenDetachedAfterNm(c []byte, mac []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpenDetached(c []byte, mac []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpenEasyAfterNm(c []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpenEasy(c []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}

+ 33 - 0
locals/gosodium/cryptobox/crypto_box_easy_dev.go-

@@ -0,0 +1,33 @@
+package cryptobox
+
+func CryptoBoxDetachedAfterNm(mac []byte, m []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxDetached(mac []byte, m []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxEasyAfterNm(m []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxEasy(m []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpenDetachedAfterNm(c []byte, mac []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpenDetached(c []byte, mac []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpenEasyAfterNm(c []byte, n []byte, k []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxOpenEasy(c []byte, n []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}

+ 40 - 0
locals/gosodium/cryptobox/crypto_box_seal.go

@@ -0,0 +1,40 @@
+//go:build !dev
+// +build !dev
+
+package cryptobox
+
+// #cgo pkg-config: libsodium
+// #include <stdlib.h>
+// #include <sodium.h>
+import "C"
+import support "kkscrap-go/locals/gosodium/support"
+
+func CryptoBoxSeal(m []byte, pk []byte) ([]byte, int) {
+	support.CheckSize(pk, CryptoBoxPublicKeyBytes(), "public key")
+	c := make([]byte, len(m)+CryptoBoxSealBytes())
+	exit := int(C.crypto_box_seal(
+		(*C.uchar)(&c[0]),
+		(*C.uchar)(&m[0]),
+		(C.ulonglong)(len(m)),
+		(*C.uchar)(&pk[0])))
+
+	return c, exit
+}
+
+func CryptoBoxSealOpen(c []byte, pk []byte, sk []byte) ([]byte, int) {
+	support.CheckSize(pk, CryptoBoxPublicKeyBytes(), "public key")
+	support.CheckSize(sk, CryptoBoxSecretKeyBytes(), "secret key")
+	m := make([]byte, len(c)-CryptoBoxSealBytes())
+	exit := int(C.crypto_box_seal_open(
+		(*C.uchar)(&m[0]),
+		(*C.uchar)(&c[0]),
+		(C.ulonglong)(len(c)),
+		(*C.uchar)(&pk[0]),
+		(*C.uchar)(&sk[0])))
+
+	return m, exit
+}
+
+func CryptoBoxSealBytes() int {
+	return int(C.crypto_box_sealbytes())
+}

+ 16 - 0
locals/gosodium/cryptobox/crypto_box_seal_dev.go

@@ -0,0 +1,16 @@
+//go:build dev
+// +build dev
+
+package cryptobox
+
+func CryptoBoxSeal(m []byte, pk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxSealOpen(c []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxSealBytes() int {
+	return 0
+}

+ 13 - 0
locals/gosodium/cryptobox/crypto_box_seal_dev.go-

@@ -0,0 +1,13 @@
+package cryptobox
+
+func CryptoBoxSeal(m []byte, pk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxSealOpen(c []byte, pk []byte, sk []byte) ([]byte, int) {
+	return nil, 0
+}
+
+func CryptoBoxSealBytes() int {
+	return 0
+}

+ 32 - 0
locals/gosodium/support/error.go

@@ -0,0 +1,32 @@
+package support
+
+import "strconv"
+
+// KeySizeError is an error that occurs when a key has an incorrect length.
+type KeySizeError int
+
+func (k KeySizeError) Error() string {
+	return "invalid key size " + strconv.Itoa(int(k))
+}
+
+// NonceSizeError is an error that occurs when a nonce has an incorrect length.
+type NonceSizeError int
+
+func (k NonceSizeError) Error() string {
+	return "invalid nonce size " + strconv.Itoa(int(k))
+}
+
+// NilPointerError is an error that occurs when a pointer is a nil pointer
+type NilPointerError string
+
+func (k NilPointerError) Error() string {
+	return string(k) + " is a nil pointer"
+}
+
+// VerificationError is an error that occurs when the verification of
+// a signature or authentication tag fails.
+type VerificationError struct {}
+
+func (k VerificationError) Error() string {
+	return "verification failed"
+}

+ 67 - 0
locals/gosodium/support/support.go

@@ -0,0 +1,67 @@
+// Package support implements support functions and errors that are used by by other libsodium-go packages.
+package support
+
+import (
+	"fmt"
+	"unsafe"
+)
+
+// CheckSize checks if the length of a byte slice is equal to the expected length,
+// and panics when this is not the case.
+func CheckSize(buf []byte, expected int, descrip string) {
+	if len(buf) != expected {
+		panic(fmt.Sprintf("Incorrect %s buffer size, expected (%d), got (%d).", descrip, expected, len(buf)))
+	}
+}
+
+// CheckSizeMin checks if the length of a byte slice is greater or equal than a minimum length,
+// and panics when this is not the case.
+func CheckSizeMin(buf []byte, min int, descrip string) {
+	if len(buf) < min {
+		panic(fmt.Sprintf("Incorrect %s buffer size, expected (>%d), got (%d).", descrip, min, len(buf)))
+	}
+}
+
+// CheckIntInRange checks if the size of an integer is between a lower and upper boundaries.
+func CheckIntInRange(n int, min int, max int, descrip string) {
+	if n < min || n > max {
+		panic(fmt.Sprintf("Incorrect %s size, expected (%d - %d), got (%d).", descrip, min, max, n))
+	}
+}
+
+// CheckSizeInRange checks if the length of a byte slice is between a lower and upper boundaries.
+func CheckSizeInRange(buf []byte, min int, max int, descrip string) {
+	if len(buf) < min || len(buf) > max {
+		panic(fmt.Sprintf("Incorrect %s buffer size, expected (%d - %d), got (%d).", descrip, min, max, len(buf)))
+	}
+}
+
+// CheckSizeGreaterOrEqual checks if the length of a byte slice is greater or equal to that of a second byte slice.
+func CheckSizeGreaterOrEqual(a, b []byte, aDescription, bDescription string) {
+	if len(a) < len(b) {
+		panic(fmt.Sprintf("%s smaller than %s", aDescription, bDescription))
+	}
+}
+
+// NilPanic is a shorthand that results in a panic when called with true.
+func NilPanic(t bool, description string) {
+	if t {
+		panic(description + " is a nil pointer")
+	}
+}
+
+// BytePointer returns a pointer to the start of a byte slice, or nil when the slice is empty.
+func BytePointer(b []byte) *uint8 {
+	if len(b) > 0 {
+		return &b[0]
+	} else {
+		return nil
+	}
+}
+
+// AlignedSlice returns a memory aligned slice
+func AlignedSlice(size, alignment int) []byte {
+	slice := make([]byte, size+alignment)
+	offset := alignment - int(uintptr(unsafe.Pointer(&slice[0])))%alignment
+	return slice[offset : offset+size]
+}

+ 94 - 0
locals/req.go

@@ -0,0 +1,94 @@
+// Author : Eric Kim
+// Build Date : 23 Jul 2008  Last Update 02 Aug 2008
+// End-Agent for Passcon Multi OS go binding with Windows, MacOS, iOS, and Android
+// All rights are reserved.
+
+package locals
+
+type DummyReq struct {
+}
+
+type IsMymenuSetReq struct {
+	TableCode string
+	MenuId    int
+	IsMymenu  string
+}
+
+type MemberAuthCom struct {
+	ActivateCode string
+	SsoBrand     string
+	SsoSub       string
+
+	Email      string
+	Password   string
+	FirstName  string
+	SurName    string
+	MobileNo   string
+	TelNo      string
+	SgroupId   int
+	SgroupCode string
+
+	Sort string // '1'의 경우 기업고객
+
+	CompanyName  string
+	CompanyClass string // 'BB'로 넣을  것것
+	FullName     string
+	TaxNo        string
+	President    string
+	ZipCode      string
+	Addr1        string
+	Addr2        string
+	BizType      string
+	DealItem     string
+	CertImg      string
+	CompanyJson  string
+}
+
+type UserAuthCom struct {
+	ActivateCode string
+	SsoBrand     string
+	SsoSub       string
+
+	Email     string
+	Password  string
+	FirstName string
+	SurName   string
+	MobileNo  string
+}
+
+// type LoginReq struct {
+// 	Email    string
+// 	Password string
+// }
+
+// type SsoLoginReq struct {
+// 	Email    string
+// 	SsoBrand string
+// 	SsoSub   string
+// }
+
+type SetupRowReq struct {
+	SetupCode string
+	BrandCode string
+}
+
+type TextVars struct {
+	Email         string
+	Encrypted     string
+	BrandCode     string
+	TemplateCode  string
+	Sender        string
+	ReservedTime  string
+	TemplateTitle string
+	TemplateText  string
+	UniqueImage   string
+}
+
+type TextPageBase struct {
+	ReplaceVars []ReplaceBase
+}
+
+type ReplaceBase struct {
+	VarName  string
+	VarValue string
+}

+ 113 - 0
locals/structs.go

@@ -0,0 +1,113 @@
+// Author : Eric Kim
+// Build Date : 23 Jul 2008  Last Update 02 Aug 2008
+// End-Agent for Passcon Multi OS go binding with Windows, MacOS, iOS, and Android
+// All rights are reserved.
+
+package locals
+
+import (
+	"github.com/go-xorm/xorm"
+)
+
+// 0. Controller  /////////////////////////////////////////////////////////////////
+
+type SyncController struct {
+	// Ctx            *context.Context
+	UpdateFieldList string
+	Scb             SyncControllerBase
+	Db              *xorm.Engine
+}
+
+var GSync SyncController
+
+type SyncControllerBase struct {
+	ConnString string
+	OfcCode    string
+}
+
+// 1. DB /////////////////////////////////////////////////////////////////
+
+type DbCom struct {
+	StartTime  int64 `xorm:"created"`
+	EndTime    int64
+	UpdateTime int64 `xorm:"updated"`
+	Ip         string
+	Usr        int64
+}
+
+// 2. Request  /////////////////////////////////////////////////////////////////
+
+type ListFormBalanceVars struct {
+	YyyyMm     string
+	SelectedId int
+	StartCode  string
+	EndCode    string
+}
+
+// 2. Response  /////////////////////////////////////////////////////////////////
+
+type ProductPage struct {
+	SolutionType string
+	ThemeType    string
+	ProductPage  []Product
+}
+
+type Product struct {
+	SolutionName  SolutionType
+	Version       string
+	Emails        []string
+	DomainName    string
+	DomainURI     string
+	ItemName      string
+	ItemNick      string
+	ModelName     string
+	ModelNo       string
+	BrandName     string
+	Sku           string
+	ItemCategory  string
+	Manufacturer  string
+	Origin        string
+	Language      string
+	Currency      string
+	SalesPrice    float32
+	DeliveryPrice float32
+	MinimumQty    float32
+	UserCredit    float32
+	Options       []Option
+	Images        []string
+	ShortDesc     string
+	OriginDesc    string
+	TextDesc      string
+}
+
+type SolutionType string
+
+var (
+	SolutionTypeWooCommerce SolutionType = "WOOCOMMERCE"
+	SolutionTypeShopify     SolutionType = "SHOPIFY"
+	SolutionTypeMagento     SolutionType = "MAGENTO"
+	SolutionTypeCafe24      SolutionType = "CAFE24"
+	SolutionTypeGodo        SolutionType = "GODO"
+	SolutionTypeYoung       SolutionType = "YOUNG"
+	SolutionTypeOthers      SolutionType = "OTHERS"
+)
+
+type Option struct {
+	Name    string
+	Choices []Choice
+}
+
+type Choice struct {
+	Name  string
+	Price float32
+}
+
+type Image struct {
+	Path   string
+	Width  int `json:"-"`
+	Height int `json:"-"`
+}
+
+type AbangoApp struct {
+	YDB *xorm.Engine
+}

+ 71 - 0
locals/themes/spider-structs-210523.go

@@ -0,0 +1,71 @@
+// Author : Eric Kim
+// Build Date : 23 Jul 2008  Last Update 02 Aug 2008
+// End-Agent for Passcon Multi OS go binding with Windows, MacOS, iOS, and Android
+// All rights are reserved.
+
+package locals_themes
+
+type ItemInfo struct {
+	SolutinName   string
+	Version       string
+	AdminEmail    string
+	DomainName    string
+	DomaminURI    string
+	ItemName      string
+	ItemNick      string
+	ModelName     string
+	ModelNo       string
+	BrandName     string
+	Sku           string
+	ItemCategory  string
+	Manufacturer  string
+	Origin        string
+	Language      string
+	Currency      string
+	SalesPrice    float32
+	DeliveryPrice float32
+	MinumumQty    float32
+	UserCredit    float32
+	Options       []Option
+	Images        []string
+	ShortDesc     string
+	OriginDesc    string
+	TextDesc      string
+}
+
+type Option struct {
+	Name    string
+	Choices []Choice
+}
+
+type Choice struct {
+	Name  string
+	Price float32
+}
+
+type Image struct {
+	Path string
+}
+
+type Desc struct {
+	Info string
+}
+
+var (
+	WordpressUrl  string = "https://seoulknit.com/shop/collar-half-sleeved-top_blue/"
+	WordpressUrl2 string = "https://www.dollshecraft.com/product/amanda-beauty-26f-classic-maxi-65cm-special-package-2/"
+	ShopifyUrl    string = "https://bt-beloria-1.myshopify.com/collections/clothing/products/sweater-classical-tshirt"
+	MagentoUrl    string = "http://mas1.magikthemes.com/index.php/linea/cloth-women/cloth-kurtas/cloth-tail-cut-kurti/dennis-lingo-solid-casual-full-sleeves-slim-black-cotton-shirt.html"
+	Cafe24Url     string = "http://ecudemo122890.cafe24.com/product/%EC%83%98%ED%94%8C%EC%83%81%ED%92%88-11-%EB%98%90%EB%8A%94-%EB%B8%8C%EB%9E%9C%EB%93%9C%EB%AA%85/19/category/28/display/1/"
+	GodoUrl       string = "http://samplemorenvy256.godomall.com/goods/goods_view.php?goodsNo=1000000039"
+	YoungUrl      string = "http://damoagift.com/shop/view.php?index_no=67813"
+
+	Remarks string = "URLs are not fixed yet and can be fixed after contract is set forth"
+
+	GodoUrl_1 string = "https://www.lachinatakorea.com/goods/goods_view.php?goodsNo=1000000255"
+	GodoUrl_2 string = "https://sf-fd.com/goods/goods_view.php?goodsNo=1000000407&mtn=2%5E%7C%5EMD%EC%B6%94%EC%B2%9C%EC%83%81%ED%92%88%5E%7C%5En"
+
+	Cafe24_1 string = "https://koskomro.com/shop/view.php?index_no=114194"
+	Cafe24_2 string = "https://ssline.kr/shop/view.php?index_no=114156"
+	Cafe2432 string = "https://naturalize.co.kr/product/detail.html?product_no=851&cate_no=134&display_group=1"
+)

+ 33 - 0
main.go

@@ -0,0 +1,33 @@
+package main
+
+import (
+	"kkscrap-go/routers"
+	routers_init_table "kkscrap-go/routers/init_table"
+	routers_init_themes "kkscrap-go/routers/init_themes"
+
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+	"github.com/tidwall/buntdb"
+)
+
+func init() {
+
+	var err error
+	if abango.MDB, err = buntdb.Open(":memory:"); err != nil {
+		e.LogErr("lsdfjlajfladfj", "BuntDB-open-error", err)
+	}
+
+	if abango.QDB, err = buntdb.Open(":memory:"); err != nil {
+		e.LogErr("ewohnlslwejr", "BuntDB-QryDB-open-error", err)
+	}
+
+	defer abango.MDB.Close()
+
+	routers_init_themes.Init()
+	routers_init_table.Init()
+
+	abango.RunServicePoint(routers.RestRouterInit) // Do not change !!
+}
+
+func main() {
+}

+ 62 - 0
model/item.go

@@ -0,0 +1,62 @@
+// Author : Eric Kim
+// Build Date : 23 Jul 2008  Last Update 02 Aug 2008
+// End-Agent for Passcon Multi OS go binding with Windows, MacOS, iOS, and Android
+// All rights are reserved.
+
+package model
+
+type ItemInfo struct {
+	SolutionName  SolutionType
+	Version       string
+	Emails        []string
+	DomainName    string
+	DomainURI     string
+	ItemName      string
+	ItemNick      string
+	ModelName     string
+	ModelNo       string
+	BrandName     string
+	Sku           string
+	ItemCategory  string
+	Manufacturer  string
+	Origin        string
+	Language      string
+	Currency      string
+	SalesPrice    float32
+	DeliveryPrice float32
+	MinimumQty    float32
+	UserCredit    float32
+	Options       []Option
+	Images        []string
+	ShortDesc     string
+	OriginDesc    string
+	TextDesc      string
+}
+
+type SolutionType string
+
+var (
+	SolutionTypeWooCommerce SolutionType = "WOOCOMMERCE"
+	SolutionTypeShopify     SolutionType = "SHOPIFY"
+	SolutionTypeMagento     SolutionType = "MAGENTO"
+	SolutionTypeCafe24      SolutionType = "CAFE24"
+	SolutionTypeGodo        SolutionType = "GODO"
+	SolutionTypeYoung       SolutionType = "YOUNG"
+	SolutionTypeOthers      SolutionType = "OTHERS"
+)
+
+type Option struct {
+	Name    string
+	Choices []Choice
+}
+
+type Choice struct {
+	Name  string
+	Price float32
+}
+
+type Image struct {
+	Path   string
+	Width  int `json:"-"`
+	Height int `json:"-"`
+}

+ 17 - 0
models/common-triggers.go

@@ -0,0 +1,17 @@
+package models
+
+// func DeleteBdRows(qryname string, y *abango.Controller, id int) error {
+
+// 	fileQry := "queries/triggers/delete" + qryname + ".sql"
+// 	sqlStr, err := abango.GetQryStr(fileQry)
+// 	if err != nil {
+// 		return errors.New(e.FuncRunErr("ewtrytbvfgr", fileQry+" file does NOT exist."))
+// 	}
+
+// 	if _, err := y.Db.Exec(sqlStr, id); err == nil {
+// 		e.FuncRun("65rfg0csde", qryname+" "+e.CurrFuncName())
+// 		return nil
+// 	} else {
+// 		return errors.New(e.FuncRunErr("65rfg0csdew", qryname+" "+e.CurrFuncName()+err.Error()))
+// 	}
+// }

+ 9 - 0
models/custom.yml

@@ -0,0 +1,9 @@
+kind: reverse
+name: syncscan_db
+source:
+  database: mysql
+  conn_str: 'syncscan_db:ICjryB3GkHB@tcp(175.126.146.155:3306)/syncscan_db'
+targets:
+- type: codes
+  language: golang
+  output_dir: ./models/table

+ 28 - 0
models/func/fmd-etc-select-name-page.go

@@ -0,0 +1,28 @@
+package models_func
+
+import (
+	"errors"
+
+	e "github.com/dabory/abango-rest/etc"
+	"github.com/go-xorm/xorm"
+)
+
+type EtcSelectName struct {
+	EtcType    string `xorm:"not null VARCHAR(21)"`
+	SelectName string `xorm:"VARCHAR(49)"`
+}
+type EtcSelectNamePageRet struct {
+	Page []EtcSelectName
+}
+
+func (t *EtcSelectNamePageRet) GetPage(YDB *xorm.Engine) error {
+
+	qry := *YDB.Select("distinctrow etc_type, select_name").Table("dbr_etc").Asc("sort_no")
+
+	if _, err := qry.FindAndCount(&t.Page); err == nil {
+		e.FuncRun("oytrsderas", e.CurrFuncName())
+		return nil
+	} else {
+		return errors.New(e.PageQryErr("mniosgfde", e.CurrFuncName()+err.Error()))
+	}
+}

+ 135 - 0
models/func/fmd-last-seq-no-get.go

@@ -0,0 +1,135 @@
+package models_func
+
+import (
+	"errors"
+
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+)
+
+// 이것 안쓰는 펑션이지만 다른것에 사용 가능하므로 일단 내비둠.
+// func LastSeqNoGet(y *abango.Controller, table string, idName string, hdId int) (int, error) {
+
+// 	seqNo := 0
+// 	sql := " select MAX(seq_no) as last_seq_no from " + locals.Tpf + table
+// 	sql += " where " + idName + " = " + e.NumToStr(hdId)
+// 	sql += " group by " + idName
+
+// 	if rs, err := y.Db.Query(sql); err == nil { //레코드가 없으면 넣어놓은 seqNo 는 0으로 유지 된다.
+// 		for _, val := range rs {
+// 			for _, val := range val {
+// 				seqNo, _ = strconv.Atoi(string(val))
+// 				// fmt.Println(val, string(val))
+// 			}
+// 		}
+// 		e.FuncRun("wqerfvdfgherh", e.CurrFuncName())
+// 		return seqNo + 1, nil //마지막번호에서 1을 더한다.
+// 	} else {
+// 		return 0, errors.New(e.FuncRunErr("owqrkmpofae", e.CurrFuncName()+err.Error()))
+// 	}
+// }
+
+type SeqNoUpDownReq struct {
+	BdTableName string
+	HdIdName    string
+	HdId        int
+	CurrId      int
+	Move        string
+	QueryCnt    int64
+}
+
+type SeqNoUpDownFuncSet struct {
+	SeqNoUpDownReq
+	CurrSeqNo int
+	Page      []SeqNoUpDownSingle
+}
+
+type SeqNoUpDownSingle struct {
+	Id    int
+	SeqNo int
+}
+
+func (t *SeqNoUpDownFuncSet) SeqNoUpDown(y *abango.Controller) error {
+
+	//NextVersion Deprecates
+	// tblName := t.BdTableName
+	// if strings.Contains(t.BdTableName, "main_") || strings.Contains(t.BdTableName, "pro_") {
+	// 	tblName = t.BdTableName
+	// } else {
+	// 	tblName = "dbr_" + t.BdTableName
+	// }
+
+	qry := *y.Db.
+		Table(t.BdTableName).
+		Select("id, seq_no").
+		Where(t.HdIdName + "=" + e.NumToStr(t.HdId)).
+		Asc("seq_no")
+
+	if err := qry.Find(&t.Page); err == nil {
+		// if cnt, err := qry.FindAndCount(&t.Page); err == nil {
+		// t.QueryCnt = cnt
+		e.FuncRun("wpkjcapqjd", e.CurrFuncName())
+		// return nil //마지막번호에서 1을 더한다.
+	} else {
+		return errors.New(e.PageQryErr("dfgdresgfsf", e.CurrFuncName()+err.Error()))
+	}
+
+	currKey := 0
+	currSeqNo := 0
+	for key, r := range t.Page {
+		if r.Id == t.CurrId {
+			currKey = key
+			currSeqNo = r.SeqNo
+			break
+		}
+	}
+
+	if currSeqNo == 0 {
+		return errors.New(e.PageQryErr("otjnsaefvq", " SeqNo does NOT exist. Check HdId/CurrID !"))
+	}
+
+	targetId := 0
+	targetSeqNo := 0
+	if t.Move == "up" {
+		if currKey == 0 {
+			return errors.New(e.PageQryErr("otjnsaefvq", "Current SeqNo is the first one "))
+		} else {
+			targetId = t.Page[currKey-1].Id
+			targetSeqNo = t.Page[currKey-1].SeqNo
+		}
+	} else if t.Move == "down" {
+		if currKey == len(t.Page)-1 {
+			return errors.New(e.PageQryErr("iueytbwerfas", "Current SeqNo is the last one "))
+		} else {
+			targetId = t.Page[currKey+1].Id
+			targetSeqNo = t.Page[currKey+1].SeqNo
+		}
+	} else {
+		return errors.New(e.PageQryErr("klkfefasfwcv", "Value of Move should be \"up\" or \"down\" "))
+	}
+
+	sess := y.Db.NewSession()
+	if err := sess.Begin(); err == nil {
+		defer sess.Close()
+	} else {
+		return errors.New(e.PageQryErr("otyhjnsefㄹㅇ", "Transaction Action Failed "))
+	}
+
+	strSql := "update " + t.BdTableName + " set seq_no = ? where id = ? "
+	if _, err := y.Db.Exec(strSql, currSeqNo, targetId); err != nil {
+		return errors.New(e.FuncRunErr("nbhserfvaew", e.CurrFuncName()+err.Error()))
+	}
+
+	if _, err := y.Db.Exec(strSql, targetSeqNo, t.CurrId); err != nil {
+		return errors.New(e.FuncRunErr("oyujxerfsew", e.CurrFuncName()+err.Error()))
+	}
+
+	if err := sess.Commit(); err == nil {
+		t.CurrSeqNo = currSeqNo
+		e.FuncRun("ptervafhhf", e.CurrFuncName())
+		return nil
+	} else {
+		return errors.New(e.FuncRunErr("oyujxerfsew", "Transaction Commit Failed"))
+	}
+
+}

+ 99 - 0
models/func/fmd-login.go

@@ -0,0 +1,99 @@
+package models_func
+
+// func (t *LoginRet) TableName() string {
+// 	return " login "
+// }
+
+// type LoginRet struct {
+// 	LoginFailed   bool
+// 	FailedMsg     string
+// 	UserId        int
+// 	Email         string
+// 	Name          string
+// 	Username      string
+// 	Surname       string
+// 	UserPermId    int
+// 	MenuLangSw    int
+// 	SgroupId      int
+// 	BranchId      int
+// 	StorageId     int
+// 	AgroupId      int
+// 	CountryCode   string
+// 	SalesQtyPoint int
+// 	SalesPrcPoint int
+// 	SalesAmtPoint int
+// 	PurchQtyPoint int
+// 	PurchPrcPoint int
+// 	PurchAmtPoint int
+// 	StockQtyPoint int
+// 	StockPrcPoint int
+// 	StockAmtPoint int
+// 	AccAmtPoint   int
+// }
+
+// type LoginPage struct {
+// 	Page []Login
+// }
+
+// type Login struct {
+// 	UserId        int
+// 	UserPermId    int
+// 	MenuLangSw    int
+// 	SgroupId      int
+// 	BranchId      int
+// 	StorageId     int
+// 	AgroupId      int
+// 	CountryCode   string
+// 	SalesQtyPoint int
+// 	SalesPrcPoint int
+// 	SalesAmtPoint int
+// 	PurchQtyPoint int
+// 	PurchPrcPoint int
+// 	PurchAmtPoint int
+// 	StockQtyPoint int
+// 	StockPrcPoint int
+// 	StockAmtPoint int
+// 	AccAmtPoint   int
+// }
+
+// func (t *LoginRet) Login(y *abango.Controller) error {
+
+// 	file := "queries/function/login.sql"
+// 	var v LoginPage
+
+// 	if sqlStr, err := abango.GetQryStr(file); err == nil {
+// 		qry := *y.Db.SQL(sqlStr, t.UserId)
+// 		if err := qry.Find(&v.Page); err == nil { //.SQL() 에서는 FindAndCount 에서 버그가 있는 것 같다.
+// 			e.PageRead("sdfasdasfasdfg", t.TableName())
+
+// 			t.UserPermId = v.Page[0].UserPermId
+
+// 			t.UserId = v.Page[0].UserId
+// 			t.MenuLangSw = v.Page[0].MenuLangSw
+// 			t.SgroupId = v.Page[0].SgroupId
+// 			t.BranchId = v.Page[0].BranchId
+// 			t.StorageId = v.Page[0].StorageId
+// 			t.AgroupId = v.Page[0].AgroupId
+// 			t.CountryCode = v.Page[0].CountryCode
+
+// 			t.SalesQtyPoint = v.Page[0].SalesQtyPoint
+// 			t.SalesPrcPoint = v.Page[0].SalesPrcPoint
+// 			t.SalesAmtPoint = v.Page[0].SalesAmtPoint
+
+// 			t.PurchQtyPoint = v.Page[0].PurchQtyPoint
+// 			t.PurchPrcPoint = v.Page[0].PurchPrcPoint
+// 			t.PurchAmtPoint = v.Page[0].PurchAmtPoint
+
+// 			t.StockQtyPoint = v.Page[0].StockQtyPoint
+// 			t.StockPrcPoint = v.Page[0].StockPrcPoint
+// 			t.StockAmtPoint = v.Page[0].StockAmtPoint
+
+// 			t.AccAmtPoint = v.Page[0].AccAmtPoint
+// 			return nil
+// 		} else {
+// 			return errors.New(e.PageQryErr("optytgbvxf", t.TableName()+err.Error()))
+// 		}
+// 	} else {
+// 		return errors.New(e.FuncRunErr("owqehtbsfdd", file+" file does NOT exist."))
+// 	}
+// }

+ 27 - 0
models/func/fmd-sgroup-select.go

@@ -0,0 +1,27 @@
+package models_func
+
+import (
+	"errors"
+
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+)
+
+type SgroupSelect struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	SgroupName string `xorm:"not null VARCHAR(49)"`
+}
+type SgroupSelectPage struct {
+	Page []SgroupSelect
+}
+
+func GetSgroupSelect(y *abango.Controller, sel *SgroupSelectPage, filter string) error { //여기서는 filter 안쓰고 슴슴
+
+	qry := *y.Db.Table("dbr_sgroup").Asc("sgroup_code").Where(filter)
+	if err := qry.Find(&sel.Page); err == nil {
+		e.FuncRun("234adsrared", e.CurrFuncName())
+		return nil
+	} else {
+		return errors.New(e.PageQryErr("ltrysgaera", e.CurrFuncName()+err.Error()))
+	}
+}

+ 34 - 0
models/func/fmd-user-select.go

@@ -0,0 +1,34 @@
+package models_func
+
+import (
+	"errors"
+
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+)
+
+type UserSelect struct {
+	Id   int    `xorm:"not null pk autoincr INT(10)"`
+	Name string `xorm:"not null VARCHAR(49)"`
+}
+type UserSelectPage struct {
+	Page []UserSelect
+}
+
+func GetUserSelect(y *abango.Controller, sel *UserSelectPage, filter string) error { //여기서는 filter 안쓰고 슴슴
+
+	qry := *y.Db.
+		Table("users").
+		Select("users.id, nick_name").
+		Join("INNER", "dbr_user_ext", "dbr_user_ext.id=users.id").
+		Where("branch_id=" + e.NumToStr(y.Gtb.BranchId)).
+		Where("is_expired = '0'").
+		Asc("nick_name")
+
+	if err := qry.Find(&sel.Page); err == nil {
+		e.FuncRun("3f34fga43far", e.CurrFuncName())
+		return nil
+	} else {
+		return errors.New(e.PageQryErr("ltrysgaera", e.CurrFuncName()+err.Error()))
+	}
+}

+ 179 - 0
models/table/function-models-table.go

@@ -0,0 +1,179 @@
+package models_table
+
+import (
+	"fmt"
+	"kkscrap-go/locals"
+	"reflect"
+	"strings"
+	"time"
+
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+	"github.com/go-xorm/xorm"
+	"github.com/google/uuid"
+)
+
+func ComAddaRowDefault(y *abango.Controller, table interface{}) {
+
+	fe := reflect.ValueOf(table).Elem()
+	fieldNum := fe.NumField()
+	for i := 0; i < fieldNum; i++ {
+		tag := string(fe.Type().Field(i).Tag)
+		name := fe.Type().Field(i).Name
+		value := fe.Field(i)
+
+		if strings.Contains(tag, "DECIMAL") && value.String() == "" {
+			fe.Field(i).SetString("0.0000")
+		} else if name == "CreatedOn" {
+			fe.Field(i).SetInt(e.GetNowUnix())
+		} else if name == "OfficialDate" {
+			fe.Field(i).SetString((time.Now().Format("20060102")))
+		} else if name == "OfficialTime" {
+			fe.Field(i).SetString((time.Now().Format("15:04:05")))
+		} else if name == "IsUnused" && value.String() == "" {
+			fe.Field(i).SetString("0")
+		} else if name == "Status" && value.String() == "" {
+			fe.Field(i).SetString("0")
+		} else if name == "Sort" && value.String() == "" {
+			fe.Field(i).SetString("0")
+		} else if name == "Ip" {
+			fe.Field(i).SetString(y.Gtb.RemoteIp)
+		} else if name == "UserId" && y.Gtb.UserId != 0 {
+			fe.Field(i).SetInt(int64(y.Gtb.UserId))
+		} else if name == "MemberId" && y.Gtb.MemberId != 0 {
+			fe.Field(i).SetInt(int64(y.Gtb.MemberId))
+		} else if name == "StorageId" {
+			fe.Field(i).SetInt(int64(y.Gtb.StorageId))
+		} else if name == "BranchId" {
+			fe.Field(i).SetInt(int64(y.Gtb.BranchId))
+		} else if name == "MemberBuyerId" && y.Gtb.MemberBuyerId != 0 {
+			fe.Field(i).SetInt(int64(y.Gtb.MemberBuyerId))
+		} else if name == "BuyerId" && value.String() == "" && y.Gtb.MemberBuyerId != 0 { //Pro에서 MemberBuyerId 지정되어 있으면
+			fe.Field(i).SetInt(int64(y.Gtb.MemberBuyerId))
+		} else if name == "ItemCode" && value.String() == "" { //UniqKey가 지정되어 있으면
+			fe.Field(i).SetString(e.RandString(16))
+			//ForeignId에  1 을 넣는 조건
+		} else if name == "Duid" && value.String() == "" { //UniqKey가 지정되어 있으면
+			uid := uuid.New()
+			fe.Field(i).SetString(uid.String())
+		}
+		//redundunt but to make sure to have no 0 value in Ids
+		if (strings.Contains(name, "MediaId") || name == "MemberId" || name == "UserId" || name == "BuyerId" || name == "SupplierId" || name == "IgroupId" || name == "CgroupId" || name == "BranchId" || name == "StorageId" || name == "AgroupId") && value.Int() == 0 {
+			fe.Field(i).SetInt(int64(1))
+		}
+		if name == "FromBuyerId" && value.Int() == 0 {
+			fe.Field(i).SetInt(int64(1))
+		}
+		if name == "FromBuyerId" && value.Int() == 0 {
+			fmt.Println("FromBuyerId:", value.Int())
+		}
+	}
+}
+
+func EmptyTableColumn(table interface{}) { // 정리해서 연결할 것.
+	fmt.Println("aaaa")
+	fe := reflect.ValueOf(table).Elem()
+	fmt.Println("bbbb")
+	fieldNum := fe.NumField()
+	fmt.Println("cccc")
+	for i := 0; i < fieldNum; i++ {
+		name := fe.Type().Field(i).Name
+		if name == "Password" || name == "ActivateCode" || name == "ResetCode" {
+			fe.Field(i).SetString("")
+		}
+	}
+}
+
+func ComEditaRowDefault(y *abango.Controller, table interface{}) {
+
+	fe := reflect.ValueOf(table).Elem()
+	fieldNum := fe.NumField()
+	for i := 0; i < fieldNum; i++ {
+
+		tag := string(fe.Type().Field(i).Tag)
+		name := fe.Type().Field(i).Name
+		value := fe.Field(i)
+
+		if strings.Contains(tag, "DECIMAL") && value.String() == "" {
+			fe.Field(i).SetString("0.0000")
+		} else if name == "UpdatedOn" {
+			fe.Field(i).SetInt(e.GetNowUnix())
+		} else if name == "OfficialDate" && value.String() == "" { //직접수정시에는 변경가능
+			fe.Field(i).SetString((time.Now().Format("20060102")))
+		} else if name == "OfficialTime" && value.String() == "" { //직접수정시에는 변경가능
+			fe.Field(i).SetString((time.Now().Format("15:04:05")))
+		} else if name == "UserId" && value.String() == "" { // 수정한 관리자 입력
+			fe.Field(i).SetInt(int64(y.Gtb.UserId))
+		} else if name == "MemberId" && value.String() == "" { // 수정한 회원 입력
+			fe.Field(i).SetInt(int64(y.Gtb.MemberId))
+		} else if name == "MemberBuyerId" && value.String() == "" { // 수정한 회원 입력
+			fe.Field(i).SetInt(int64(y.Gtb.MemberBuyerId))
+		} else if name == "IsUnused" && value.String() == "" {
+			fe.Field(i).SetString("0")
+		} else if name == "Status" && value.String() == "" {
+			fe.Field(i).SetString("0")
+		} else if name == "Sort" && value.String() == "" {
+			fe.Field(i).SetString("0")
+		} else if name == "Ip" { //최종업데이트한 Ip가 들어간다.
+			fe.Field(i).SetString(y.Gtb.RemoteIp)
+		}
+
+		if (strings.Contains(name, "MediaId") || name == "MemberId" || name == "UserId" || name == "BuyerId" || name == "SupplierId" || name == "IgroupId" || name == "CgroupId" || name == "BranchId" || name == "StorageId" || name == "AgroupId") && value.Int() == 0 {
+			fe.Field(i).SetInt(int64(1))
+		}
+	}
+}
+
+func ComUpdateQry(y *abango.Controller, id int) *xorm.Session {
+
+	qry := y.Db.Id(id)
+	if y.UpdateFieldList != "" {
+		slc := strings.Split(y.UpdateFieldList, ",")
+		for _, str := range slc {
+			qry = qry.Cols(str)
+		}
+	} else { //UpdateFieldList가 비었으면 전체 컬럼선텍
+		qry = qry.AllCols()
+	}
+	return qry
+}
+
+func SyncEditaRowDefault(y *locals.SyncController, table interface{}) {
+
+	fe := reflect.ValueOf(table).Elem()
+	fieldNum := fe.NumField()
+	for i := 0; i < fieldNum; i++ {
+
+		tag := string(fe.Type().Field(i).Tag)
+		name := fe.Type().Field(i).Name
+		value := fe.Field(i)
+
+		if strings.Contains(tag, "DECIMAL") && value.String() == "" {
+			fe.Field(i).SetString("0.0000")
+		} else if name == "UpdatedOn" {
+			fe.Field(i).SetInt(e.GetNowUnix())
+		} else if name == "Status" && value.String() == "" {
+			fe.Field(i).SetString("0")
+		} else if name == "Sort" && value.String() == "" {
+			fe.Field(i).SetString("0")
+		}
+
+		if (strings.Contains(name, "SampleId")) && value.Int() == 0 {
+			fe.Field(i).SetInt(int64(1))
+		}
+	}
+}
+
+func SyncUpdateQry(y *locals.SyncController, id int) *xorm.Session {
+
+	qry := y.Db.Id(id)
+	if y.UpdateFieldList != "" {
+		slc := strings.Split(y.UpdateFieldList, ",")
+		for _, str := range slc {
+			qry = qry.Cols(str)
+		}
+	} else { //UpdateFieldList가 비었으면 전체 컬럼선텍
+		qry = qry.AllCols()
+	}
+	return qry
+}

+ 3164 - 0
models/table/models.go

@@ -0,0 +1,3164 @@
+package models_table
+
+import (
+	"time"
+)
+
+type CrmAccount struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	BuyerId   int    `xorm:"not null INT(10)"`
+	OrderBy   string `xorm:"not null default '' VARCHAR(64)"`
+	Str0      string `xorm:"VARCHAR(64)"`
+	Str1      string `xorm:"VARCHAR(64)"`
+	Str2      string `xorm:"VARCHAR(64)"`
+	Str3      string `xorm:"VARCHAR(64)"`
+	Str4      string `xorm:"VARCHAR(64)"`
+	Str5      string `xorm:"VARCHAR(64)"`
+	Str6      string `xorm:"VARCHAR(64)"`
+	Str7      string `xorm:"VARCHAR(64)"`
+	Str8      string `xorm:"VARCHAR(64)"`
+	Str9      string `xorm:"VARCHAR(64)"`
+	Rng0      string `xorm:"VARCHAR(64)"`
+	Rng1      string `xorm:"VARCHAR(64)"`
+	Rng2      string `xorm:"VARCHAR(64)"`
+	Rng3      string `xorm:"VARCHAR(64)"`
+	Rng4      string `xorm:"VARCHAR(64)"`
+	Rng5      string `xorm:"VARCHAR(64)"`
+	Rng6      string `xorm:"VARCHAR(64)"`
+	Rng7      string `xorm:"VARCHAR(64)"`
+	Rng8      string `xorm:"VARCHAR(64)"`
+	Rng9      string `xorm:"VARCHAR(64)"`
+	Dec0      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec1      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec2      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec3      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec4      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec5      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec6      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec7      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec8      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec9      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Chk0Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk0Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk0Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk0Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk0Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk1Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk1Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk1Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk1Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk1Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk2Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk2Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk2Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk2Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk2Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk3Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk3Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk3Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk3Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk3Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk4Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk4Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk4Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk4Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk4Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk5Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk5Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk5Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk5Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk5Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk6Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk6Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk6Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk6Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk6Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk7Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk7Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk7Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk7Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk7Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk8Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk8Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk8Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk8Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk8Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk9Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk9Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk9Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk9Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk9Opt4  string `xorm:"default '0' CHAR(1)"`
+}
+
+type CrmAccountItem struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	AccountId int    `xorm:"not null INT(10)"`
+	OrderBy   string `xorm:"default '' VARCHAR(64)"`
+	Str0      string `xorm:"VARCHAR(64)"`
+	Str1      string `xorm:"VARCHAR(64)"`
+	Str2      string `xorm:"VARCHAR(64)"`
+	Str3      string `xorm:"VARCHAR(64)"`
+	Str4      string `xorm:"VARCHAR(64)"`
+	Str5      string `xorm:"VARCHAR(64)"`
+	Str6      string `xorm:"VARCHAR(64)"`
+	Str7      string `xorm:"VARCHAR(64)"`
+	Str8      string `xorm:"VARCHAR(64)"`
+	Str9      string `xorm:"VARCHAR(64)"`
+	Rng0      string `xorm:"VARCHAR(64)"`
+	Rng1      string `xorm:"VARCHAR(64)"`
+	Rng2      string `xorm:"VARCHAR(64)"`
+	Rng3      string `xorm:"VARCHAR(64)"`
+	Rng4      string `xorm:"VARCHAR(64)"`
+	Rng5      string `xorm:"VARCHAR(64)"`
+	Rng6      string `xorm:"VARCHAR(64)"`
+	Rng7      string `xorm:"VARCHAR(64)"`
+	Rng8      string `xorm:"VARCHAR(64)"`
+	Rng9      string `xorm:"VARCHAR(64)"`
+	Dec0      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec1      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec2      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec3      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec4      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec5      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec6      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec7      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec8      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Dec9      string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Chk0Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk0Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk0Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk0Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk0Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk1Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk1Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk1Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk1Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk1Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk2Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk2Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk2Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk2Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk2Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk3Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk3Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk3Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk3Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk3Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk4Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk4Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk4Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk4Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk4Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk5Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk5Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk5Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk5Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk5Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk6Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk6Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk6Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk6Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk6Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk7Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk7Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk7Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk7Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk7Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk8Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk8Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk8Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk8Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk8Opt4  string `xorm:"default '0' CHAR(1)"`
+	Chk9Opt0  string `xorm:"default '0' CHAR(1)"`
+	Chk9Opt1  string `xorm:"default '0' CHAR(1)"`
+	Chk9Opt2  string `xorm:"default '0' CHAR(1)"`
+	Chk9Opt3  string `xorm:"default '0' CHAR(1)"`
+	Chk9Opt4  string `xorm:"default '0' CHAR(1)"`
+}
+
+type CrmProject struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	ProjectDate  string `xorm:"not null default '' index CHAR(8)"`
+	ProjectNo    string `xorm:"comment('프로젝트번호:자동채번') unique VARCHAR(21)"`
+	ProjectName  string `xorm:"not null comment('프로젝트명') VARCHAR(128)"`
+	ContractAmt  string `xorm:"not null default 0.0000 comment('계약금액') DECIMAL(20,4)"`
+	PreCostAmt   string `xorm:"not null default 0.0000 comment('예상비용금액') DECIMAL(20,4)"`
+	SquoteId     int    `xorm:"comment('연결견적번호') index INT(10)"`
+	UserId       int    `xorm:"not null comment('사용자 id:(5)Default') index INT(10)"`
+	SgroupId     int    `xorm:"comment('영업구분:안경사') index INT(10)"`
+	BranchId     int    `xorm:"comment('지점:본사(1)Default') index INT(10)"`
+	BuyerId      int    `xorm:"comment('고객id') index INT(10)"`
+	VatRateId    int    `xorm:"comment('부가세율:포함(1)Default,별도(0)') index INT(10)"`
+	BuyerContact string `xorm:"comment('고객담당자') VARCHAR(49)"`
+	PayTerms     string `xorm:"comment('지불조건') VARCHAR(69)"`
+	PayPeriod    string `xorm:"comment('지불기간') VARCHAR(69)"`
+	Destination  string `xorm:"comment('도착지역') VARCHAR(69)"`
+	Delivery     string `xorm:"comment('납기') VARCHAR(69)"`
+	Status       string `xorm:"comment('상황:완료(3)') CHAR(1)"`
+	IsClosed     string `xorm:"not null comment('종결처리') CHAR(1)"`
+	IsFirstOrder string `xorm:"not null default '0' comment('고객의 첫번째 주문여부') CHAR(1)"`
+	Column1      string `xorm:"VARCHAR(69)"`
+	Column2      string `xorm:"VARCHAR(69)"`
+	Remarks      string `xorm:"TEXT"`
+	Json1        string `xorm:"comment('현재 사용하지 않음') TEXT"`
+	Json2        string `xorm:"comment('현재 사용하지 않음') TEXT"`
+	IsLocked     string `xorm:"not null default '0' comment('정산완료(1)-수정불가') CHAR(1)"`
+	Ip           string `xorm:"VARCHAR(20)"`
+}
+
+type CrpNetGroup struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	SeqNo      int    `xorm:"default 0 TINYINT(4)"`
+	Sort       string `xorm:"default '0' CHAR(1)"`
+	NetSymbol  string `xorm:"VARCHAR(20)"`
+	NetName    string `xorm:"not null comment('메인넷 이름') VARCHAR(49)"`
+	WalletName string `xorm:"not null VARCHAR(49)"`
+	IsUnused   string `xorm:"not null default '0' comment('0:사용중, 1:사용않음') CHAR(1)"`
+}
+
+type CrpTokenGroup struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	SeqNo        int    `xorm:"default 0 TINYINT(4)"`
+	NetGroupId   int    `xorm:"not null default 0 INT(1)"`
+	Sort         string `xorm:"default '0' CHAR(1)"`
+	TokenSymbol  string `xorm:"VARCHAR(20)"`
+	TokenName    string `xorm:"not null VARCHAR(49)"`
+	TokenAddr    string `xorm:"comment('토큰 컨트랙트 주소') VARCHAR(42)"`
+	UnitPoint    int    `xorm:"not null default 0 comment('적용소숫점') TINYINT(4)"`
+	FeePoint     int    `xorm:"not null default 0 comment('GasFee적용 소숫점') TINYINT(4)"`
+	DecimalPoint int    `xorm:"not null default 0 comment('유효표시 소숫점') TINYINT(4)"`
+	IsCoin       string `xorm:"not null default '0' comment('코인여부') CHAR(1)"`
+	IsListed     string `xorm:"not null default '0' comment('상장여부') CHAR(1)"`
+	IsInitToken  string `xorm:"not null default '0' comment('초기화 토큰여부') CHAR(1)"`
+	IsUnused     string `xorm:"not null default '0' comment('사용 중지') CHAR(1)"`
+	MainSwapAddr string `xorm:"comment('스왑지갑 주소') VARCHAR(42)"`
+	IsSwapBase   string `xorm:"not null default '0' comment('스왑용 지갑여부') CHAR(1)"`
+	IsBlockSwap  string `xorm:"not null default '0' comment('스왑 중지') CHAR(1)"`
+	SwapRate     string `xorm:"default 0.00 comment('메인코인과의 스왑비율') DECIMAL(5,2)"`
+	CurrKrwPrice string `xorm:"default 0.0000 comment('현재 환율') DECIMAL(20,4)"`
+	ChangeRate   string `xorm:"default 0.0000 comment('사용않음 나중에지울것') DECIMAL(7,4)"`
+}
+
+type CrpWallet struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	MemberId   int    `xorm:"not null INT(11)"`
+	NetGroupId int    `xorm:"not null default 0 INT(11)"`
+	WalletAddr string `xorm:"VARCHAR(200)"`
+	PkeyEncr   string `xorm:"comment('암호화된 AES PriKey(256bits)') VARCHAR(256)"`
+	IsUnused   string `xorm:"default '0' CHAR(1)"`
+	Ip         string `xorm:"VARCHAR(20)"`
+}
+
+type CrpWalletToken struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	WalletId     int    `xorm:"not null INT(11)"`
+	TokenGroupId int    `xorm:"not null INT(11)"`
+	Ip           string `xorm:"VARCHAR(20)"`
+}
+
+type DbrAccCode struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	AccCode      string `xorm:"not null default '1101' VARCHAR(5)"`
+	AccCrDr      string `xorm:"not null default '3' CHAR(1)"`
+	AccName      string `xorm:"not null VARCHAR(60)"`
+	AccNameRpt   string `xorm:"not null VARCHAR(121)"`
+	AccName2     string `xorm:"not null VARCHAR(121)"`
+	AccName3     string `xorm:"not null VARCHAR(121)"`
+	AccName4     string `xorm:"not null VARCHAR(121)"`
+	IsLocked     string `xorm:"not null default '0' CHAR(1)"`
+	PlusMinus    string `xorm:"not null default '0' CHAR(1)"`
+	IsChung      string `xorm:"not null default '0' CHAR(1)"`
+	IsTotalCol   string `xorm:"not null default '0' CHAR(1)"`
+	IsImportCost string `xorm:"not null default '0' CHAR(1)"`
+	IsAccCompany string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type DbrAccSlip struct {
+	Id          int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	AccSlipNo   string `xorm:"VARCHAR(21)"`
+	SorderId    int    `xorm:"INT(10)"`
+	PorderId    int    `xorm:"INT(10)"`
+	UserId      int    `xorm:"not null default 0 INT(10)"`
+	BranchId    int    `xorm:"not null default 0 INT(10)"`
+	SgroupId    int    `xorm:"not null default 0 INT(10)"`
+	AccDate     string `xorm:"VARCHAR(8)"`
+	CompanyId   int    `xorm:"INT(11)"`
+	DealTypeId  int    `xorm:"INT(11)"`
+	BillType    string `xorm:"comment('CC:신용카드, CS:현금, GC:쿠폰, UC:적립금사용') CHAR(2)"`
+	BillColumn1 string `xorm:"comment('사용카드, 현금영수증, 쿠폰발행, 사용여부') VARCHAR(21)"`
+	BillColumn2 string `xorm:"VARCHAR(21)"`
+	SlipAmt     string `xorm:"DECIMAL(20,4)"`
+	OccurDate   string `xorm:"VARCHAR(8)"`
+	Remarks     string `xorm:"MEDIUMTEXT"`
+	CardCheckNo string `xorm:"VARCHAR(36)"`
+	AutoSlipId  int    `xorm:"not null default 0 INT(10)"`
+	AutoSlipAmt string `xorm:"DECIMAL(20,4)"`
+	IsFixed     string `xorm:"CHAR(1)"`
+	IsApproved  string `xorm:"not null default '0' CHAR(1)"`
+	Status      string `xorm:"CHAR(21)"`
+	Ip          string `xorm:"VARCHAR(20)"`
+}
+
+type DbrAccSlipBd struct {
+	Id           int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	AccSlipId    int    `xorm:"not null INT(10)"`
+	SeqNo        int    `xorm:"not null TINYINT(4)"`
+	SlipCrDr     string `xorm:"not null CHAR(1)"`
+	AccCodeId    int    `xorm:"default 0 INT(10)"`
+	AccCompanyId int    `xorm:"default 0 INT(10)"`
+	AccEtcName   string `xorm:"VARCHAR(69)"`
+	EtcAdd1      string `xorm:"VARCHAR(69)"`
+	EtcAdd2      string `xorm:"VARCHAR(69)"`
+	AccAmt       string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	Ip           string `xorm:"VARCHAR(20)"`
+}
+
+type DbrAccTitle struct {
+	Id                int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn         int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn         int64  `xorm:"default 0 BIGINT(20)"`
+	TitleCode         string `xorm:"not null default '' comment('계정과목코드') VARCHAR(6)"`
+	AccDrCr           int    `xorm:"not null default 3 comment('차대변') TINYINT(4)"`
+	TitleName         string `xorm:"not null default '' comment('계정과목명') VARCHAR(64)"`
+	AtgroupCode       string `xorm:"not null default '' comment('집합계정코드') VARCHAR(16)"`
+	PlusMinus         string `xorm:"not null default '0' comment('증가차감') CHAR(1)"`
+	IsChung           string `xorm:"not null default '0' comment('충당금계정') CHAR(1)"`
+	IsTotal           string `xorm:"not null default '0' comment('합계계정') CHAR(1)"`
+	IsImportCost      string `xorm:"not null default '0' comment('수입비용계정') CHAR(1)"`
+	Level3AtgroupCode string `xorm:"not null default '' comment('3단계집합코드') VARCHAR(16)"`
+	RepTitleCode      string `xorm:"not null default '' comment('대표계정코드') VARCHAR(16)"`
+	IsAccCompany      string `xorm:"not null default '0' comment('회계업체존재') CHAR(1)"`
+	IsSkipped         string `xorm:"not null default '0' comment('사용않음') CHAR(1)"`
+}
+
+type DbrAgroup struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	AgroupCode   string `xorm:"VARCHAR(20)"`
+	AgroupName   string `xorm:"VARCHAR(49)"`
+	AgrTaxRegno  string `xorm:"VARCHAR(21)"`
+	AgrFullName  string `xorm:"VARCHAR(96)"`
+	AgrPresident string `xorm:"VARCHAR(96)"`
+	AgrZipcode   string `xorm:"VARCHAR(21)"`
+	AgrAddr1     string `xorm:"VARCHAR(49)"`
+	AgrAddr2     string `xorm:"VARCHAR(49)"`
+	AgrBizType   string `xorm:"VARCHAR(191)"`
+	AgrDealItem  string `xorm:"VARCHAR(191)"`
+	IsUnused     string `xorm:"CHAR(1)"`
+}
+
+type DbrAppSlip struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	AppSlipNo  string `xorm:"VARCHAR(21)"`
+	AccSlipId  int    `xorm:"not null default 0 INT(10)"`
+	UserId     int    `xorm:"not null default 0 INT(10)"`
+	AppDate    string `xorm:"VARCHAR(8)"`
+	AppRemarks string `xorm:"MEDIUMTEXT"`
+	Ip         string `xorm:"VARCHAR(20)"`
+}
+
+type DbrBalAccTitle struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	YyyyMm     string `xorm:"not null VARCHAR(6)"`
+	AgroupId   int    `xorm:"not null default 1 comment('회계단위구분') INT(10)"`
+	BranchId   int    `xorm:"not null default 1 comment('지사 ID') INT(11)"`
+	AccTitleId int    `xorm:"not null default 1 comment('계정과목 ID') INT(10)"`
+	DrBalAmt   string `xorm:"not null default 0.0000 comment('차변잔액') DECIMAL(20,4)"`
+	CrBalAmt   string `xorm:"not null default 0.0000 comment('대변잔액') DECIMAL(20,4)"`
+}
+
+type DbrBalBuyer struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	YyyyMm    string `xorm:"not null VARCHAR(6)"`
+	BranchId  int    `xorm:"not null INT(10)"`
+	BuyerId   int    `xorm:"not null default 0 INT(10)"`
+	BalAmt    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+}
+
+type DbrBalCredit struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	YyyyMm    string `xorm:"not null VARCHAR(6)"`
+	BranchId  int    `xorm:"not null INT(10)"`
+	BuyerId   int    `xorm:"not null default 0 INT(10)"`
+	BalAmt    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+}
+
+type DbrBalItem struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	YyyyMm    string `xorm:"not null VARCHAR(6)"`
+	StorageId int    `xorm:"not null default 0 INT(10)"`
+	ItemId    int    `xorm:"not null default 0 INT(10)"`
+	BalQty    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	BadBalQty string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+}
+
+type DbrBalReward struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	YyyyMm    string `xorm:"not null VARCHAR(6)"`
+	BranchId  int    `xorm:"not null INT(10)"`
+	BuyerId   int    `xorm:"not null default 0 INT(10)"`
+	BalAmt    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+}
+
+type DbrBalSupplier struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	YyyyMm     string `xorm:"not null VARCHAR(6)"`
+	BranchId   int    `xorm:"not null INT(10)"`
+	SupplierId int    `xorm:"not null default 0 INT(10)"`
+	BalAmt     string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+}
+
+type DbrBranch struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	BranchCode    string `xorm:"VARCHAR(20)"`
+	BranchName    string `xorm:"VARCHAR(49)"`
+	BranchManager string `xorm:"VARCHAR(49)"`
+	IsUnused      string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type DbrCalDay struct {
+	Day string `xorm:"not null pk unique VARCHAR(8)"`
+}
+
+type DbrCalFormat struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	DateType  string `xorm:"VARCHAR(5)"`
+	DateIndex string `xorm:"not null unique VARCHAR(8)"`
+}
+
+type DbrCgroup struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	CgroupCode    string `xorm:"comment('업체구분--Code') VARCHAR(20)"`
+	CgroupName    string `xorm:"VARCHAR(49)"`
+	CgroupManager string `xorm:"VARCHAR(49)"`
+	IsUnused      string `xorm:"default '0' CHAR(1)"`
+}
+
+type DbrCompany struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	CompanyDate   string `xorm:"not null default '20200101' comment('업체등록일') index CHAR(8)"`
+	CompanyNo     string `xorm:"not null default '20220101-01' comment('업체등록 번호') unique VARCHAR(21)"`
+	CgroupId      int    `xorm:"comment('업체구분') index INT(10)"`
+	CompanyName   string `xorm:"comment('고객약칭') index VARCHAR(32)"`
+	CompanyClass  string `xorm:"default '' comment('업체등급:AA(개인고객), AB(기업고객), BB(기업공급처)') index VARCHAR(2)"`
+	FullName      string `xorm:"not null default '' comment('고객성명(전체이름)') VARCHAR(96)"`
+	MobileNo      string `xorm:"index VARCHAR(21)"`
+	Email         string `xorm:"VARCHAR(64)"`
+	Sex           string `xorm:"comment('m:남성, w:여성') CHAR(1)"`
+	BirthDate     string `xorm:"CHAR(8)"`
+	IsLunar       string `xorm:"comment('0:양력, 1:음력') CHAR(1)"`
+	CardChar4     string `xorm:"comment('지울것') VARCHAR(4)"`
+	MainContact   string `xorm:"comment('주담당자: POS의 경우 고객이름(동명이인 사용가능)으로 사용') VARCHAR(21)"`
+	TelNo         string `xorm:"index VARCHAR(21)"`
+	FaxNo         string `xorm:"VARCHAR(21)"`
+	TaxNo         string `xorm:"comment('사업자 등록 번호') VARCHAR(21)"`
+	President     string `xorm:"comment('대표자명') VARCHAR(96)"`
+	ZipCode       string `xorm:"comment('우편번호') VARCHAR(21)"`
+	Addr1         string `xorm:"comment('현주소') VARCHAR(49)"`
+	Addr2         string `xorm:"comment('상세주소') VARCHAR(49)"`
+	BizType       string `xorm:"comment('업태') VARCHAR(191)"`
+	DealItem      string `xorm:"comment('종목') VARCHAR(191)"`
+	IsDealEnd     string `xorm:"not null default '0' comment('거래중지') CHAR(1)"`
+	IsOkText      string `xorm:"not null default '0' comment('문자접수승인') CHAR(1)"`
+	IsOkEmail     string `xorm:"not null default '0' comment('이메일접수승인') CHAR(1)"`
+	IsOkDm        string `xorm:"default '0' comment('DM접수승인') CHAR(1)"`
+	CurrCreditBal string `xorm:"not null default 0.0000 comment('지울것') DECIMAL(20,4)"`
+	Remarks       string `xorm:"MEDIUMTEXT"`
+	CertImg       string `xorm:"default '' comment('사업자등록증 사진') VARCHAR(256)"`
+	CompanyJson   string `xorm:"comment('커스터마이징 내용') TEXT"`
+	Ip            string `xorm:"VARCHAR(21)"`
+}
+
+type DbrCoupon struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UserId     int    `xorm:"not null default 0 INT(10)"`
+	CouponType string `xorm:"CHAR(1)"`
+	BranchId   int    `xorm:"not null default 0 INT(10)"`
+	IssueType  string `xorm:"CHAR(1)"`
+	IssueDate  string `xorm:"not null VARCHAR(8)"`
+	CouponName string `xorm:"VARCHAR(36)"`
+	CouponCode string `xorm:"VARCHAR(21)"`
+	IsRate     string `xorm:"not null default '0' CHAR(1)"`
+	CouponNum  string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	ExpireDate string `xorm:"VARCHAR(8)"`
+	CouponDesc string `xorm:"VARCHAR(68)"`
+	Ip         string `xorm:"VARCHAR(20)"`
+}
+
+type DbrCpack struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	CpackName string `xorm:"VARCHAR(21)"`
+	CpackMemo string `xorm:"not null MEDIUMTEXT"`
+}
+
+type DbrCredit struct {
+	Id          int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	CreditNo    string `xorm:"unique VARCHAR(21)"`
+	CreditDate  string `xorm:"VARCHAR(8)"`
+	DealTypeId  int    `xorm:"INT(10)"`
+	IsTransfer  string `xorm:"not null default '0' CHAR(1)"`
+	FromBuyerId int    `xorm:"not null default 0 INT(10)"`
+	ToBuyerId   int    `xorm:"not null default 0 INT(10)"`
+	BranchId    int    `xorm:"not null default 0 INT(10)"`
+	UserId      int    `xorm:"not null default 0 INT(10)"`
+	ManualAmt   string `xorm:"DECIMAL(20,4)"`
+	Remarks     string `xorm:"TEXT"`
+	Ip          string `xorm:"VARCHAR(20)"`
+}
+
+type DbrCustomerTieBd struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	CustomerTieId int    `xorm:"default 0 INT(10)"`
+	SeqNo         int    `xorm:"not null TINYINT(4)"`
+	BranchId      int    `xorm:"not null default 0 INT(10)"`
+	UserId        int    `xorm:"not null default 0 INT(10)"`
+	BuyerId       int    `xorm:"not null default 0 INT(10)"`
+	Ref1          string `xorm:"VARCHAR(49)"`
+	Ref2          string `xorm:"VARCHAR(49)"`
+	IsLeader      string `xorm:"not null default '0' CHAR(1)"`
+	Ip            string `xorm:"VARCHAR(21)"`
+}
+
+type DbrCustomerTie struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	CustomerTieNo string `xorm:"unique VARCHAR(21)"`
+	TieDate       string `xorm:"VARCHAR(8)"`
+	TieName       string `xorm:"VARCHAR(36)"`
+	BranchId      int    `xorm:"not null default 0 INT(10)"`
+	UserId        int    `xorm:"not null default 0 INT(10)"`
+	Status        string `xorm:"VARCHAR(21)"`
+	IsClosed      string `xorm:"not null default '0' CHAR(1)"`
+	Remarks       string `xorm:"TEXT"`
+	Ip            string `xorm:"VARCHAR(20)"`
+}
+
+type DbrCreditBd struct {
+	Id          int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	HdId        int    `xorm:"not null default 0 INT(11)"`
+	BdId        int    `xorm:"not null default 0 INT(11)"`
+	CreditId    int    `xorm:"not null default 0 INT(10)"`
+	AvailDate   string `xorm:"not null default '0' CHAR(8)"`
+	OccurDate   string `xorm:"default '0' CHAR(8)"`
+	BranchId    int    `xorm:"not null default 0 INT(10)"`
+	UserId      int    `xorm:"not null default 0 INT(10)"`
+	DealTypeId  int    `xorm:"not null default 0 INT(10)"`
+	IsFromBuyer string `xorm:"CHAR(1)"`
+	BuyerId     int    `xorm:"not null default 0 INT(10)"`
+	CreditAmt   string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	AddMsg      string `xorm:"VARCHAR(64)"`
+}
+
+type DbrDailyCalc struct {
+	Id          int    `xorm:"not null pk autoincr unique INT(10)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	CalcDate    string `xorm:"CHAR(8)"`
+	CalcMonth   string `xorm:"CHAR(6)"`
+	CalcYear    string `xorm:"CHAR(4)"`
+	LastCash    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	SalesAmt    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	SalesTot    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	PayedAmt    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	PayedTot    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	ChargeAmt   string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	ChargeTot   string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	CashAmt     string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	CashTot     string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	CcardAmt    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	CcardTot    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	RewardAmt   string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	RewardTot   string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	DcountAmt   string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	DcountTot   string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	ExpenseAmt  string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	ExpenseTot  string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	CashoutAmt  string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	CashoutToto string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	CurrCash    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	CashdiffAmt string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	CashdiffTot string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	SalesCnt    int    `xorm:"INT(11)"`
+	NewvisitCnt int    `xorm:"INT(11)"`
+	RevisitCnt  int    `xorm:"INT(11)"`
+}
+
+type DbrDealType struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	DealCategory  string `xorm:"not null default '' comment('매출/매입/수불 등') VARCHAR(21)"`
+	SortNo        int    `xorm:"not null comment('순서번호') TINYINT(4)"`
+	DealCode      string `xorm:"not null default '' comment('거래구분코드') VARCHAR(2)"`
+	DealName      string `xorm:"not null default '' comment('거래구분명') VARCHAR(21)"`
+	SalesStatus   int    `xorm:"not null comment('매출상황(+)(-)') TINYINT(4)"`
+	PurchStatus   int    `xorm:"not null comment('매입상황(+)(-)') TINYINT(4)"`
+	CollectStatus int    `xorm:"not null default 0 comment('입출금(+)(-)') TINYINT(4)"`
+	StockStatus   int    `xorm:"not null default 0 TINYINT(4)"`
+	BadstkStatus  int    `xorm:"not null TINYINT(4)"`
+	CoststkStatus int    `xorm:"not null TINYINT(4)"`
+	CreditStatus  int    `xorm:"not null TINYINT(4)"`
+	RewardStatus  int    `xorm:"not null TINYINT(4)"`
+	ExDateStatus  int    `xorm:"not null comment('마감일자상황') TINYINT(4)"`
+	IsGenIo       int    `xorm:"not null comment('일반이동처리') TINYINT(4)"`
+	IsReqRetro    int    `xorm:"not null comment('소급요청') TINYINT(4)"`
+	GenIoPrtField string `xorm:"not null default '' VARCHAR(49)"`
+}
+
+type DbrEtc struct {
+	Id             int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	EtcType        string `xorm:"not null VARCHAR(21)"`
+	SelectName     string `xorm:"VARCHAR(49)"`
+	SortNo         int    `xorm:"not null default 0 TINYINT(4)"`
+	Value          string `xorm:"VARCHAR(191)"`
+	Caption        string `xorm:"VARCHAR(191)"`
+	IsUnchangeable string `xorm:"not null default '0' CHAR(1)"`
+	IsUndeletable  string `xorm:"not null default '0' CHAR(1)"`
+	EtcMemo        string `xorm:"MEDIUMTEXT"`
+}
+
+type DbrGenio struct {
+	Id             int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	GenioNo        string `xorm:"unique VARCHAR(21)"`
+	GenioDate      string `xorm:"VARCHAR(8)"`
+	DealTypeId     int    `xorm:"not null default 0 INT(10)"`
+	UserId         int    `xorm:"not null default 0 INT(10)"`
+	SgroupId       int    `xorm:"not null default 0 INT(10)"`
+	BranchId       int    `xorm:"not null default 0 INT(10)"`
+	StorageId      int    `xorm:"not null default 0 INT(10)"`
+	CompanyId      int    `xorm:"not null default 0 INT(10)"`
+	VatRateId      int    `xorm:"not null default 0 INT(10)"`
+	CompanyContact string `xorm:"VARCHAR(49)"`
+	OurContact     string `xorm:"VARCHAR(49)"`
+	Status         string `xorm:"VARCHAR(21)"`
+	Column1        string `xorm:"VARCHAR(69)"`
+	Column2        string `xorm:"not null VARCHAR(69)"`
+	Remarks        string `xorm:"TEXT"`
+	Ip             string `xorm:"VARCHAR(20)"`
+}
+
+type DbrItem struct {
+	Id              int    `xorm:"not null pk autoincr index(mdx_id_code) INT(10)"`
+	UploadBatch     string `xorm:"not null default '' comment('업로드 1회처리 모음') VARCHAR(21)"`
+	CreatedOn       int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn       int64  `xorm:"not null default 0 BIGINT(11)"`
+	IgroupId        int    `xorm:"not null index INT(10)"`
+	SupplierId      int    `xorm:"default 0 comment('공급자(company.id)') index INT(11)"`
+	ItemCode        string `xorm:"not null unique index(mdx_id_code) VARCHAR(21)"`
+	ItemName        string `xorm:"not null index VARCHAR(82)"`
+	SubName         string `xorm:"not null default '' comment('규격,옵션등') VARCHAR(65)"`
+	CountUnit       string `xorm:"comment('수량단위(EA등)') VARCHAR(5)"`
+	PurchPrc        string `xorm:"default 0.0000 comment('매입가') DECIMAL(18,4)"`
+	SalesPrc        string `xorm:"default 0.0000 comment('매출가') DECIMAL(18,4)"`
+	DiscountPrc     string `xorm:"not null default 0.0000 comment('할인가') DECIMAL(18,4)"`
+	ItemMemo        string `xorm:"comment('품목메모필드-non_html') TEXT"`
+	ItemDesc        string `xorm:"comment('품목설명-html') TEXT"`
+	IheaderId       int    `xorm:"comment('품목헤더(무역용)') index INT(10)"`
+	IsMaterial      string `xorm:"not null default '0' comment('0:상품 1:원부자재') CHAR(1)"`
+	IsItemEnd       string `xorm:"not null default '0' comment('BOM상의 반제품아님') CHAR(1)"`
+	IsStyle         string `xorm:"not null default '0' comment('스타일여부') CHAR(1)"`
+	IsSelfOption    string `xorm:"not null default '0' comment('0:표준옵션, 1:자체옵션') CHAR(1)"`
+	StyleId         int    `xorm:"not null default 0 comment('종속스타일(Assort만 적용됨)') index INT(11)"`
+	IsntPro         string `xorm:"not null default '0' comment('0;온오프판매가능, 1:온라인판매않음') CHAR(1)"`
+	IsntStkio       string `xorm:"not null default '0' comment('수불처리않음') CHAR(1)"`
+	IsCreditProduct string `xorm:"not null default '0' comment('충전금상품') CHAR(1)"`
+	OfferCredit     string `xorm:"not null default 0.0000 comment('제공충전포인트') DECIMAL(18,4)"`
+	RewardRate      string `xorm:"not null default 0.00 comment('적립%') DECIMAL(4,2)"`
+	RewardAmt       string `xorm:"not null default 0.0000 comment('적립금액') DECIMAL(18,4)"`
+	MediaId         int    `xorm:"not null default 1 comment('미디어라이프러리id') index INT(11)"`
+	ThmMediaCnt     int    `xorm:"not null default 0 comment('thm의 추가 이미지 갯수') TINYINT(4)"`
+	Status          string `xorm:"not null default '0' CHAR(1)"`
+	Ip              string `xorm:"VARCHAR(21)"`
+	Duid            string `xorm:"default '' comment('API 클러스터용') CHAR(36)"`
+	ItemSlug        string `xorm:"not null default '' comment('품목슬러그') unique VARCHAR(128)"`
+	ItemMeta        string `xorm:"not null comment('품목Seo-Meta') TEXT"`
+}
+
+type DbrGenioBd struct {
+	Id          int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	GenioId     int    `xorm:"not null INT(10)"`
+	SeqNo       int    `xorm:"not null TINYINT(4)"`
+	ItemId      int    `xorm:"not null INT(10)"`
+	GenioQty    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	GenioPrc    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	GenioSupply string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	GenioVat    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	GenioSum    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	Ref1        string `xorm:"VARCHAR(69)"`
+	Ref2        string `xorm:"VARCHAR(69)"`
+	GenioDesc   string `xorm:"MEDIUMTEXT"`
+	GenioMemo   string `xorm:"TEXT"`
+	Ip          string `xorm:"VARCHAR(20)"`
+}
+
+type DbrGlobal struct {
+	Id            int   `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64 `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64 `xorm:"default 0 BIGINT(20)"`
+	AgroupId      int   `xorm:"default 0 INT(11)"`
+	SalesQtyPoint int   `xorm:"not null default 0 TINYINT(3)"`
+	SalesPrcPoint int   `xorm:"not null default 0 TINYINT(1)"`
+	SalesAmtPoint int   `xorm:"not null default 0 TINYINT(1)"`
+	PurchQtyPoint int   `xorm:"not null default 0 TINYINT(1)"`
+	PurchPrcPoint int   `xorm:"not null default 0 TINYINT(1)"`
+	PurchAmtPoint int   `xorm:"not null default 0 TINYINT(1)"`
+	StockQtyPoint int   `xorm:"not null default 0 TINYINT(1)"`
+	StockPrcPoint int   `xorm:"not null default 0 TINYINT(1)"`
+	StockAmtPoint int   `xorm:"not null default 0 TINYINT(1)"`
+	AccAmtPoint   int   `xorm:"not null default 0 TINYINT(1)"`
+}
+
+type DbrIgroup struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	IgroupCode string `xorm:"not null default '' unique VARCHAR(20)"`
+	IgroupName string `xorm:"not null default '' VARCHAR(49)"`
+	MediaId    int    `xorm:"not null default 1 comment('미디어라이블러리 연결') INT(11)"`
+	Sort       string `xorm:"not null default '000' VARCHAR(3)"`
+	Status     string `xorm:"not null default '0' CHAR(1)"`
+	IsEndLevel string `xorm:"not null default '0' CHAR(1)"`
+	Duid       string `xorm:"not null default '' comment('SEO/API클러스터') CHAR(36)"`
+	IgroupSlug string `xorm:"not null default '' comment('품목구분슬러그') VARCHAR(128)"`
+	IgroupMeta string `xorm:"not null default ' ' comment('품목구분Seo-Meta') TEXT"`
+}
+
+type DbrIheader struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	HeaderName string `xorm:"VARCHAR(21)"`
+	HeaderDesc string `xorm:"MEDIUMTEXT"`
+	IsUse      string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type FedCrystalHost struct {
+	Id        int    `xorm:"not null pk autoincr unique INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"not null VARCHAR(21)"`
+	Position  string `xorm:"not null VARCHAR(10)"`
+	OrderBy   string `xorm:"VARCHAR(32)"`
+	C1        string `xorm:"VARCHAR(64)"`
+	C2        string `xorm:"VARCHAR(64)"`
+	C3        string `xorm:"VARCHAR(64)"`
+	C4        string `xorm:"VARCHAR(64)"`
+	C5        string `xorm:"VARCHAR(64)"`
+	C6        string `xorm:"VARCHAR(64)"`
+	C7        string `xorm:"VARCHAR(64)"`
+	C8        string `xorm:"VARCHAR(64)"`
+	C9        string `xorm:"VARCHAR(64)"`
+	C10       string `xorm:"VARCHAR(64)"`
+	C11       string `xorm:"VARCHAR(64)"`
+	C12       string `xorm:"VARCHAR(64)"`
+	C13       string `xorm:"VARCHAR(64)"`
+	C14       string `xorm:"VARCHAR(64)"`
+	C15       string `xorm:"VARCHAR(64)"`
+	C16       string `xorm:"VARCHAR(64)"`
+	C17       string `xorm:"VARCHAR(64)"`
+	C18       string `xorm:"VARCHAR(64)"`
+	C19       string `xorm:"VARCHAR(64)"`
+	C20       string `xorm:"VARCHAR(64)"`
+	D1        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D2        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D3        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D4        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D5        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D6        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D7        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D8        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D9        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D10       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	IsSum     string `xorm:"not null default '0' CHAR(1)"`
+	T1        string `xorm:"MEDIUMTEXT"`
+	T2        string `xorm:"MEDIUMTEXT"`
+}
+
+type DbtListSum struct {
+	TId       int    `xorm:"not null pk autoincr unique INT(10)"`
+	HId       int    `xorm:"not null default 0 comment('전표 Header id') INT(11)"`
+	Id        int    `xorm:"INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"not null VARCHAR(21)"`
+	OrderBy   string `xorm:"VARCHAR(64)"`
+	C1        string `xorm:"VARCHAR(64)"`
+	C2        string `xorm:"VARCHAR(64)"`
+	C3        string `xorm:"VARCHAR(64)"`
+	C4        string `xorm:"VARCHAR(64)"`
+	C5        string `xorm:"VARCHAR(64)"`
+	C6        string `xorm:"VARCHAR(64)"`
+	C7        string `xorm:"VARCHAR(64)"`
+	C8        string `xorm:"VARCHAR(64)"`
+	C9        string `xorm:"VARCHAR(64)"`
+	C10       string `xorm:"VARCHAR(64)"`
+	C11       string `xorm:"VARCHAR(64)"`
+	C12       string `xorm:"VARCHAR(64)"`
+	C13       string `xorm:"VARCHAR(64)"`
+	C14       string `xorm:"VARCHAR(64)"`
+	C15       string `xorm:"VARCHAR(64)"`
+	C16       string `xorm:"VARCHAR(64)"`
+	C17       string `xorm:"VARCHAR(64)"`
+	C18       string `xorm:"VARCHAR(64)"`
+	C19       string `xorm:"VARCHAR(64)"`
+	C20       string `xorm:"VARCHAR(64)"`
+	D1        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D2        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D3        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D4        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D5        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D6        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D7        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D8        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D9        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D10       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	IsSum     string `xorm:"not null default '0' CHAR(1)"`
+	T1        string `xorm:"MEDIUMTEXT"`
+	T2        string `xorm:"MEDIUMTEXT"`
+}
+
+type DbrItemOption struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"not null default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"not null default 0 BIGINT(20)"`
+	SeqNo      int    `xorm:"not null default 0 comment('순서') TINYINT(4)"`
+	OptionCode string `xorm:"not null default '' comment('옵션코드') unique VARCHAR(6)"`
+	OptionType string `xorm:"not null default '' comment('옵션구분') VARCHAR(6)"`
+	OptionName string `xorm:"not null default '' comment('옵션이름') VARCHAR(32)"`
+	IsUnused   string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type DbrItemOptpro struct {
+	Id             int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn      int64  `xorm:"not null default 0 BIGINT(20)"`
+	UpdatedOn      int64  `xorm:"not null default 0 BIGINT(20)"`
+	ItemId         int    `xorm:"not null comment('품목 id') INT(11)"`
+	SeqNo          int    `xorm:"not null default 0 comment('순서') TINYINT(4)"`
+	ColorId        int    `xorm:"not null default 1 comment('color id') index INT(11)"`
+	SizeId         int    `xorm:"not null default 1 comment('size id') index INT(11)"`
+	SelfSizeName   string `xorm:"not null default '' comment('자체 사이즈 옵션명') VARCHAR(32)"`
+	SelfColorName  string `xorm:"not null default '' comment('자체 컬러 옵션명') VARCHAR(32)"`
+	SelfOptionCode string `xorm:"not null default '' comment('자체 옵션코드') VARCHAR(6)"`
+	PurchPrc       string `xorm:"not null default 0.0000 comment('매입가') DECIMAL(18,4)"`
+	SalesPrc       string `xorm:"not null default 0.0000 comment('매출가') DECIMAL(18,4)"`
+	Ip             string `xorm:"not null default '' VARCHAR(21)"`
+}
+
+type DbrItemThm struct {
+	Id          int    `xorm:"not null pk INT(10)"`
+	UploadBatch string `xorm:"not null default '' comment('업로드 1회처리 모음') VARCHAR(21)"`
+	CreatedOn   int64  `xorm:"not null default 0 comment('생성일시 unixtime') BIGINT(20)"`
+	MediaId1    int    `xorm:"not null default 1 comment('1st 썸네일이미지') INT(11)"`
+	MediaId2    int    `xorm:"not null default 1 comment('2nd 썸네일이미지') INT(11)"`
+	MediaId3    int    `xorm:"not null default 1 comment('3th 썸네일이미지') INT(11)"`
+	MediaId4    int    `xorm:"not null default 1 comment('4th 썸네일이미지') INT(11)"`
+	MediaId5    int    `xorm:"not null default 1 comment('5th 썸네일이미지') INT(11)"`
+	MediaId6    int    `xorm:"not null default 1 comment('6번 추가이미지') INT(11)"`
+	MediaId7    int    `xorm:"not null default 1 comment('7번 추가이미지') INT(11)"`
+	MediaId8    int    `xorm:"not null default 1 comment('8번 추가이미지') INT(11)"`
+	MediaId9    int    `xorm:"not null default 1 comment('9번 추가이미지') INT(11)"`
+	MediaId10   int    `xorm:"not null default 1 comment('10번 추가이미지') INT(11)"`
+	Pc1         string `xorm:"VARCHAR(64)"`
+	Pc2         string `xorm:"VARCHAR(64)"`
+	Pc3         string `xorm:"VARCHAR(64)"`
+	Pc4         string `xorm:"VARCHAR(64)"`
+	Pc5         string `xorm:"VARCHAR(64)"`
+	Pc6         string `xorm:"VARCHAR(64)"`
+	Pc7         string `xorm:"VARCHAR(64)"`
+	Pc8         string `xorm:"VARCHAR(64)"`
+	Pc9         string `xorm:"VARCHAR(64)"`
+	Pc10        string `xorm:"VARCHAR(64)"`
+	Pd1         string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd2         string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd3         string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd4         string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd5         string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd6         string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd7         string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd8         string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd9         string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd10        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+}
+
+type DbrLastSlipNo struct {
+	Id             int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	SlipDatePrefix string `xorm:"not null unique VARCHAR(31)"`
+	LastSlipSerial int    `xorm:"not null default 1 INT(11)"`
+	IsLocked       string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type DbrMedia struct {
+	Id            int    `xorm:"not null pk autoincr comment('레코드1은 빈이미지로 지정') INT(11)"`
+	UploadBatch   string `xorm:"not null default '' comment('업로드 1회처리 모음') VARCHAR(21)"`
+	UploadItemId  int    `xorm:"not null default 0 comment('업로드와 연결된 item_id') INT(11)"`
+	UploadPostfix int    `xorm:"not null default 0 comment('upload용 추가이미지 번호') TINYINT(4)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	MediaNo       string `xorm:"not null default '' comment('자동번호:일자-일련번호, 품목업로드시:품목코드~x') unique VARCHAR(23)"`
+	MediaDate     string `xorm:"not null default '' VARCHAR(8)"`
+	UserId        int    `xorm:"not null default 0 INT(10)"`
+	BranchId      int    `xorm:"not null default 0 INT(10)"`
+	MediaBrand    string `xorm:"not null default '' VARCHAR(32)"`
+	MediaName     string `xorm:"not null default '' VARCHAR(64)"`
+	FileUrl       string `xorm:"not null default '' VARCHAR(256)"`
+	FileSize      int    `xorm:"not null default 0 INT(10)"`
+	MediaWidth    int    `xorm:"not null default 0 INT(10)"`
+	MediaHeight   int    `xorm:"not null default 0 INT(10)"`
+	MineType      string `xorm:"not null default '' VARCHAR(256)"`
+	IsBdMatch     string `xorm:"default '0' CHAR(1)"`
+	MediaCaption  string `xorm:"not null default '' VARCHAR(128)"`
+	IsClosed      string `xorm:"not null default '0' CHAR(1)"`
+	Ip            string `xorm:"VARCHAR(20)"`
+}
+
+type DbrMediaBd struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	MediaId    int    `xorm:"default 1 INT(11)"`
+	SeqNo      int    `xorm:"not null default 0 TINYINT(4)"`
+	ImageType  string `xorm:"VARCHAR(64)"`
+	BdFileUrl  string `xorm:"VARCHAR(256)"`
+	BdFileSize int    `xorm:"INT(10)"`
+	BdWidth    int    `xorm:"INT(10)"`
+	BdHeight   int    `xorm:"INT(10)"`
+}
+
+type DbrPorder struct {
+	Id              int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn       int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn       int64  `xorm:"default 0 BIGINT(20)"`
+	SorderId        int    `xorm:"INT(11)"`
+	PorderNo        string `xorm:"unique VARCHAR(21)"`
+	PorderDate      string `xorm:"not null default '' CHAR(8)"`
+	DealTypeId      int    `xorm:"not null default 0 INT(10)"`
+	UserId          int    `xorm:"not null default 0 INT(10)"`
+	SgroupId        int    `xorm:"not null default 0 INT(10)"`
+	BranchId        int    `xorm:"not null default 0 INT(10)"`
+	StorageId       int    `xorm:"not null default 0 INT(10)"`
+	SupplierId      int    `xorm:"not null default 0 INT(10)"`
+	VatRateId       int    `xorm:"not null default 0 INT(10)"`
+	SupplierContact string `xorm:"VARCHAR(49)"`
+	PayTerms        string `xorm:"VARCHAR(69)"`
+	PayPeriod       string `xorm:"VARCHAR(69)"`
+	Destination     string `xorm:"VARCHAR(69)"`
+	Delivery        string `xorm:"VARCHAR(69)"`
+	RefNo           string `xorm:"VARCHAR(49)"`
+	OurContact      string `xorm:"VARCHAR(49)"`
+	Status          string `xorm:"VARCHAR(21)"`
+	Situation       string `xorm:"comment('안좋은 상황코드(claim등)') CHAR(2)"`
+	IsClosed        string `xorm:"not null default '0' CHAR(1)"`
+	Column1         string `xorm:"VARCHAR(69)"`
+	Column2         string `xorm:"not null VARCHAR(69)"`
+	Remarks         string `xorm:"TEXT"`
+	Ip              string `xorm:"VARCHAR(20)"`
+	IsLocked        string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type DbrPorderBd struct {
+	Id           int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	PorderId     int    `xorm:"not null INT(10)"`
+	SorderDbId   int    `xorm:"not null default 0 INT(11)"`
+	SeqNo        int    `xorm:"not null TINYINT(4)"`
+	ItemId       int    `xorm:"not null INT(10)"`
+	PorderQty    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	PorderPrc    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	PorderSupply string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	PorderVat    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	PorderSum    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	DiscountRate string `xorm:"not null default 0.0000 DECIMAL(6,4)"`
+	StdPurchPrc  string `xorm:"DECIMAL(20,4)"`
+	DeliDate     string `xorm:"VARCHAR(8)"`
+	ConfirmDate  string `xorm:"VARCHAR(8)"`
+	PorderMemo   string `xorm:"TEXT"`
+	Ref1         string `xorm:"VARCHAR(69)"`
+	Ref2         string `xorm:"VARCHAR(69)"`
+	PorderDesc   string `xorm:"TEXT"`
+	IsEnd        int    `xorm:"not null default 0 TINYINT(4)"`
+	Ip           string `xorm:"VARCHAR(20)"`
+}
+
+type DbtListType1 struct {
+	TId       int    `xorm:"not null pk autoincr unique INT(10)"`
+	HId       int    `xorm:"not null default 0 comment('전표 Header id') INT(11)"`
+	Id        int    `xorm:"INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"not null VARCHAR(21)"`
+	OrderBy   string `xorm:"VARCHAR(64)"`
+	C1        string `xorm:"VARCHAR(64)"`
+	C2        string `xorm:"VARCHAR(64)"`
+	C3        string `xorm:"VARCHAR(64)"`
+	C4        string `xorm:"VARCHAR(64)"`
+	C5        string `xorm:"VARCHAR(64)"`
+	C6        string `xorm:"VARCHAR(64)"`
+	C7        string `xorm:"VARCHAR(64)"`
+	C8        string `xorm:"VARCHAR(64)"`
+	C9        string `xorm:"VARCHAR(64)"`
+	C10       string `xorm:"VARCHAR(64)"`
+	C11       string `xorm:"VARCHAR(64)"`
+	C12       string `xorm:"VARCHAR(64)"`
+	C13       string `xorm:"VARCHAR(64)"`
+	C14       string `xorm:"VARCHAR(64)"`
+	C15       string `xorm:"VARCHAR(64)"`
+	C16       string `xorm:"VARCHAR(64)"`
+	C17       string `xorm:"VARCHAR(64)"`
+	C18       string `xorm:"VARCHAR(64)"`
+	C19       string `xorm:"VARCHAR(64)"`
+	C20       string `xorm:"VARCHAR(64)"`
+	D1        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D2        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D3        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D4        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D5        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D6        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D7        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D8        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D9        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D10       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	IsSum     string `xorm:"not null default '0' CHAR(1)"`
+	T1        string `xorm:"MEDIUMTEXT"`
+	T2        string `xorm:"MEDIUMTEXT"`
+}
+
+type FedOfficeGuest struct {
+	Id            int    `xorm:"not null pk autoincr unique INT(10)"`
+	CreatedOn     int    `xorm:"not null default unix_timestamp() INT(11)"`
+	UpdatedOn     int    `xorm:"not null default unix_timestamp() INT(11)"`
+	OfcCode       string `xorm:"not null VARCHAR(21)"`
+	OfcPlace      string `xorm:"VARCHAR(128)"`
+	OfcName       string `xorm:"VARCHAR(128)"`
+	OfcTaxNo      string `xorm:"VARCHAR(32)"`
+	OfcEmail      string `xorm:"VARCHAR(128)"`
+	OfcTelNo      string `xorm:"VARCHAR(16)"`
+	OfcFaxNo      string `xorm:"VARCHAR(16)"`
+	OfcMobile     string `xorm:"VARCHAR(16)"`
+	OfcZipCode    string `xorm:"VARCHAR(16)"`
+	OfcPresident  string `xorm:"VARCHAR(64)"`
+	OfcAddress    string `xorm:"VARCHAR(256)"`
+	OfcBizType    string `xorm:"VARCHAR(64)"`
+	OfcDealType   string `xorm:"VARCHAR(64)"`
+	SalesQtyPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	SalesPrcPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	SalesAmtPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	PurchQtyPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	PurchPrcPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	PurchAmtPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	StockQtyPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	StockPrcPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	StockAmtPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	AccAmtPoint   int    `xorm:"not null default 0 TINYINT(4)"`
+}
+
+type DbrPosClosing struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	BranchId      int    `xorm:"not null default 0 unique(branch_date) INT(10)"`
+	ClosingDate   string `xorm:"not null default '' comment('정산일자') unique(branch_date) CHAR(8)"`
+	UserId        int    `xorm:"not null INT(10)"`
+	SalesDay      string `xorm:"default 0.0000 comment('매출일합계') DECIMAL(18,4)"`
+	SalesMonth    string `xorm:"default 0.0000 comment('매출월누계') DECIMAL(18,4)"`
+	PureDay       string `xorm:"default 0.0000 comment('순매출일합계(외상제외금액)') DECIMAL(18,4)"`
+	PureMonth     string `xorm:"default 0.0000 comment('순매출월누계(외상제외금액) ') DECIMAL(18,4)"`
+	CreditDay     string `xorm:"default 0.0000 comment('외상일합계') DECIMAL(18,4)"`
+	CreditMonth   string `xorm:"default 0.0000 comment('외상월합계') DECIMAL(18,4)"`
+	CashDay       string `xorm:"default 0.0000 comment('현금매출일합계') DECIMAL(18,4)"`
+	CashMonth     string `xorm:"default 0.0000 comment('현금매출월누계') DECIMAL(18,4)"`
+	CcardDay      string `xorm:"default 0.0000 comment('신용카드매출일합계') DECIMAL(18,4)"`
+	CcardMonth    string `xorm:"default 0.0000 comment('신용카드월매출누계') DECIMAL(18,4)"`
+	RewardDay     string `xorm:"default 0.0000 comment('적립금매출일합계') DECIMAL(18,4)"`
+	RewardMonth   string `xorm:"default 0.0000 comment('적립금매출월누계') DECIMAL(18,4)"`
+	DiscountDay   string `xorm:"default 0.0000 comment('할인금액일합계') DECIMAL(18,4)"`
+	DiscountMonth string `xorm:"default 0.0000 comment('할인금액월누계') DECIMAL(18,4)"`
+	ExpenseDay    string `xorm:"default 0.0000 comment('지출금액일합계') DECIMAL(18,4)"`
+	ExpenseMonth  string `xorm:"default 0.0000 comment('지출금액월누계') DECIMAL(18,4)"`
+	CashExpDay    string `xorm:"default 0.0000 comment('현금지출일합계') DECIMAL(18,4)"`
+	CashExpMonth  string `xorm:"default 0.0000 comment('현금지출월누계') DECIMAL(18,4)"`
+	CcardExpDay   string `xorm:"default 0.0000 comment('카드지출일합계') DECIMAL(18,4)"`
+	CcardExpMonth string `xorm:"default 0.0000 comment('카드지출월누계') DECIMAL(18,4)"`
+	SorderCnt     int    `xorm:"not null default 0 comment('오더건수') INT(11)"`
+	SorderNew     int    `xorm:"not null default 0 comment('신규건수') INT(11)"`
+	RevisitCnt    int    `xorm:"not null default 0 comment('재방문건수') INT(11)"`
+	ErrorDay      string `xorm:"default 0.0000 comment('현금오차일합계') DECIMAL(18,4)"`
+	ErrorMonth    string `xorm:"default 0.0000 comment('현금오차월누계') DECIMAL(18,4)"`
+	LastCashBal   string `xorm:"default 0.0000 comment('이월현금잔액') DECIMAL(18,4)"`
+	CurrCashBal   string `xorm:"default 0.0000 comment('현재현금잔액') DECIMAL(18,4)"`
+	MemoDesc      string `xorm:"comment('메모') MEDIUMTEXT"`
+	IsApproved    string `xorm:"not null default '0' comment('승인여부') CHAR(1)"`
+	Ip            string `xorm:"VARCHAR(21)"`
+}
+
+type DbrPquote struct {
+	Id             int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	PquoteNo       string `xorm:"not null unique VARCHAR(21)"`
+	PquoteDate     string `xorm:"not null VARCHAR(8)"`
+	DealTypeId     int    `xorm:"not null INT(10)"`
+	UserId         int    `xorm:"not null INT(10)"`
+	SgroupId       int    `xorm:"not null INT(10)"`
+	BranchId       int    `xorm:"not null INT(10)"`
+	SupplierId     int    `xorm:"not null INT(10)"`
+	VatRateId      int    `xorm:"not null INT(10)"`
+	CompanyContact string `xorm:"VARCHAR(49)"`
+	PayTerms       string `xorm:"VARCHAR(69)"`
+	PayPeriod      string `xorm:"VARCHAR(69)"`
+	Destination    string `xorm:"VARCHAR(69)"`
+	Delivery       string `xorm:"VARCHAR(69)"`
+	Status         string `xorm:"comment('상태') CHAR(1)"`
+	IsClosed       string `xorm:"not null CHAR(1)"`
+	Column1        string `xorm:"VARCHAR(69)"`
+	Column2        string `xorm:"VARCHAR(69)"`
+	Remarks        string `xorm:"TEXT"`
+	Ip             string `xorm:"VARCHAR(20)"`
+}
+
+type DbrPquoteBd struct {
+	Id           int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	PquoteId     int    `xorm:"not null INT(10)"`
+	SeqNo        int    `xorm:"not null TINYINT(4)"`
+	ItemId       int    `xorm:"not null INT(10)"`
+	PquoteQty    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	PquotePrc    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	PquoteSupply string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	PquoteVat    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	PquoteSum    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	DiscountRate string `xorm:"not null default 0.0000 DECIMAL(6,4)"`
+	DeliDate     string `xorm:"VARCHAR(8)"`
+	ConfirmDate  string `xorm:"VARCHAR(8)"`
+	Ref1         string `xorm:"VARCHAR(69)"`
+	Ref2         string `xorm:"VARCHAR(69)"`
+	PquoteMemo   string `xorm:"TEXT"`
+	PquoteDesc   string `xorm:"TEXT"`
+	Ip           string `xorm:"VARCHAR(20)"`
+}
+
+type DbrPurch struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	PorderId     int    `xorm:"not null default 0 INT(10)"`
+	PurchNo      string `xorm:"unique VARCHAR(21)"`
+	PurchDate    string `xorm:"VARCHAR(8)"`
+	StockDate    string `xorm:"VARCHAR(8)"`
+	Remarks      string `xorm:"TEXT"`
+	UserId       int    `xorm:"not null default 0 INT(10)"`
+	IsNotStockIo string `xorm:"not null default '0' CHAR(1)"`
+	Ip           string `xorm:"VARCHAR(20)"`
+	IsLocked     string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type DbrPurchBd struct {
+	Id          int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	PurchId     int    `xorm:"not null default 0 INT(10)"`
+	PorderBdId  int    `xorm:"not null default 0 INT(10)"`
+	SeqNo       int    `xorm:"not null default 0 TINYINT(4)"`
+	PurchQty    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	CostPrc     string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	PurchSupply string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	PurchVat    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	PurchSum    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	Ip          string `xorm:"VARCHAR(20)"`
+}
+
+type FedOfficeHost struct {
+	Id            int    `xorm:"not null pk autoincr unique INT(10)"`
+	CreatedOn     int    `xorm:"not null default unix_timestamp() INT(11)"`
+	UpdatedOn     int    `xorm:"not null default unix_timestamp() INT(11)"`
+	OfcCode       string `xorm:"not null VARCHAR(21)"`
+	OfcPlace      string `xorm:"VARCHAR(128)"`
+	OfcName       string `xorm:"VARCHAR(128)"`
+	FedOfficeHost string `xorm:"VARCHAR(128)"`
+	OfcTaxNo      string `xorm:"VARCHAR(32)"`
+	OfcEmail      string `xorm:"VARCHAR(128)"`
+	OfcTelNo      string `xorm:"VARCHAR(16)"`
+	OfcFaxNo      string `xorm:"VARCHAR(16)"`
+	OfcMobile     string `xorm:"VARCHAR(16)"`
+	OfcZipCode    string `xorm:"VARCHAR(16)"`
+	OfcPresident  string `xorm:"VARCHAR(64)"`
+	OfcAddress    string `xorm:"VARCHAR(256)"`
+	OfcBizType    string `xorm:"VARCHAR(64)"`
+	OfcDealType   string `xorm:"VARCHAR(64)"`
+	SalesQtyPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	SalesPrcPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	SalesAmtPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	PurchQtyPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	PurchPrcPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	PurchAmtPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	StockQtyPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	StockPrcPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	StockAmtPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	AccAmtPoint   int    `xorm:"not null default 0 TINYINT(4)"`
+}
+
+type DbrUserPerm struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	PermNo    string `xorm:"unique VARCHAR(21)"`
+	PermDate  string `xorm:"CHAR(8)"`
+	PermName  string `xorm:"VARCHAR(50)"`
+	PermDesc  string `xorm:"VARCHAR(200)"`
+}
+
+type DbtLogAccess struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	MemberId  int    `xorm:"INT(11)"`
+	UserId    int    `xorm:"INT(11)"`
+	Url       string `xorm:"VARCHAR(128)"`
+	FrontIp   string `xorm:"VARCHAR(16)"`
+	FrontHost string `xorm:"VARCHAR(128)"`
+	RemoteIp  string `xorm:"VARCHAR(16)"`
+	Referer   string `xorm:"VARCHAR(1000)"`
+}
+
+type DbrReward struct {
+	Id          int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	RewardNo    string `xorm:"unique VARCHAR(21)"`
+	RewardDate  string `xorm:"VARCHAR(8)"`
+	DealTypeId  int    `xorm:"INT(10)"`
+	IsTransfer  string `xorm:"not null default '0' CHAR(1)"`
+	FromBuyerId int    `xorm:"not null default 0 INT(10)"`
+	ToBuyerId   int    `xorm:"not null default 0 INT(10)"`
+	BranchId    int    `xorm:"not null default 0 INT(10)"`
+	UserId      int    `xorm:"not null default 0 INT(10)"`
+	ManualAmt   string `xorm:"DECIMAL(20,4)"`
+	Remarks     string `xorm:"TINYTEXT"`
+	Ip          string `xorm:"VARCHAR(20)"`
+}
+
+type DbtUploadType1 struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"not null VARCHAR(21)"`
+	OrderBy   string `xorm:"VARCHAR(32)"`
+	C1        string `xorm:"TINYTEXT"`
+	C2        string `xorm:"TINYTEXT"`
+	C3        string `xorm:"TINYTEXT"`
+	C4        string `xorm:"TINYTEXT"`
+	C5        string `xorm:"TINYTEXT"`
+	C6        string `xorm:"TINYTEXT"`
+	C7        string `xorm:"TINYTEXT"`
+	C8        string `xorm:"TINYTEXT"`
+	C9        string `xorm:"TINYTEXT"`
+	C10       string `xorm:"TINYTEXT"`
+	C11       string `xorm:"TINYTEXT"`
+	C12       string `xorm:"TINYTEXT"`
+	C13       string `xorm:"TINYTEXT"`
+	C14       string `xorm:"TINYTEXT"`
+	C15       string `xorm:"TINYTEXT"`
+	C16       string `xorm:"TINYTEXT"`
+	C17       string `xorm:"TINYTEXT"`
+	C18       string `xorm:"TINYTEXT"`
+	C19       string `xorm:"TINYTEXT"`
+	C20       string `xorm:"TINYTEXT"`
+	C21       string `xorm:"TINYTEXT"`
+	C22       string `xorm:"TINYTEXT"`
+	C23       string `xorm:"TINYTEXT"`
+	C24       string `xorm:"TINYTEXT"`
+	C25       string `xorm:"TINYTEXT"`
+	C26       string `xorm:"TINYTEXT"`
+	C27       string `xorm:"TINYTEXT"`
+	C28       string `xorm:"TINYTEXT"`
+	C29       string `xorm:"TINYTEXT"`
+	C30       string `xorm:"TINYTEXT"`
+}
+
+type DbrRewardBd struct {
+	Id          int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	HdId        int    `xorm:"not null default 0 INT(11)"`
+	BdId        int    `xorm:"not null default 0 INT(11)"`
+	RewardId    int    `xorm:"not null default 0 INT(10)"`
+	AvailDate   string `xorm:"not null default '0' CHAR(8)"`
+	OccurDate   string `xorm:"default '0' CHAR(8)"`
+	BranchId    int    `xorm:"not null default 0 INT(10)"`
+	UserId      int    `xorm:"not null default 0 INT(10)"`
+	DealTypeId  int    `xorm:"not null default 0 INT(10)"`
+	IsFromBuyer string `xorm:"CHAR(1)"`
+	BuyerId     int    `xorm:"not null default 0 INT(10)"`
+	RewardRate  string `xorm:"DECIMAL(4,2)"`
+	RewardAmt   string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	AddMsg      string `xorm:"VARCHAR(64)"`
+}
+
+type DbrRptCustom struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	CustomCode    string `xorm:"VARCHAR(64)"`
+	SeqNo         int    `xorm:"TINYINT(4)"`
+	IsCustom      string `xorm:"not null default '0' CHAR(1)"`
+	RptName       string `xorm:"VARCHAR(256)"`
+	ApiName       string `xorm:"VARCHAR(128)"`
+	QueryName     string `xorm:"VARCHAR(128)"`
+	ReportPath    string `xorm:"VARCHAR(128)"`
+	ReportFmt     string `xorm:"VARCHAR(64)"`
+	ServerPrinter string `xorm:"VARCHAR(64)"`
+}
+
+type DbrSales struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	SorderId   int    `xorm:"not null default 0 INT(10)"`
+	SalesNo    string `xorm:"unique VARCHAR(21)"`
+	SalesDate  string `xorm:"VARCHAR(8)"`
+	StockDate  string `xorm:"VARCHAR(8)"`
+	Remarks    string `xorm:"TEXT"`
+	UserId     int    `xorm:"not null default 0 INT(10)"`
+	DeliUserId int    `xorm:"INT(10)"`
+	Ip         string `xorm:"VARCHAR(20)"`
+	IsLocked   string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type DbrSalesBd struct {
+	Id          int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	SalesId     int    `xorm:"not null default 0 index INT(10)"`
+	SorderBdId  int    `xorm:"not null default 0 INT(10)"`
+	SeqNo       int    `xorm:"not null default 0 TINYINT(4)"`
+	SalesQty    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	CostPrc     string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	SalesSupply string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	SalesVat    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	SalesSum    string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	Ip          string `xorm:"VARCHAR(20)"`
+}
+
+type DbtWebcatCart struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	BranchId  int    `xorm:"not null default 1 INT(10)"`
+	UserIs    int    `xorm:"not null default 5 INT(10)"`
+	ItemCode  string `xorm:"not null VARCHAR(21)"`
+	CartPrc   string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+}
+
+type DbrUserPermBd struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UserPermId int    `xorm:"not null INT(10)"`
+	UserMenuId int    `xorm:"not null INT(11)"`
+	IsUse      string `xorm:"not null CHAR(1)"`
+	IsMymenu   string `xorm:"not null default '0' CHAR(1)"`
+	IsList     string `xorm:"not null CHAR(1)"`
+	IsRead     string `xorm:"not null CHAR(1)"`
+	IsCreate   string `xorm:"not null CHAR(1)"`
+	IsUpdate   string `xorm:"not null CHAR(1)"`
+	IsDelete   string `xorm:"not null CHAR(1)"`
+	IsNewtab   string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type FedCrystalGuest struct {
+	Id        int    `xorm:"not null pk autoincr unique INT(10)"`
+	CreatedOn int    `xorm:"not null default unix_timestamp() INT(11)"`
+	ListToken string `xorm:"not null VARCHAR(21)"`
+	Position  string `xorm:"not null VARCHAR(10)"`
+	OrderBy   string `xorm:"VARCHAR(32)"`
+	C1        string `xorm:"VARCHAR(64)"`
+	C2        string `xorm:"VARCHAR(64)"`
+	C3        string `xorm:"VARCHAR(64)"`
+	C4        string `xorm:"VARCHAR(64)"`
+	C5        string `xorm:"VARCHAR(64)"`
+	C6        string `xorm:"VARCHAR(64)"`
+	C7        string `xorm:"VARCHAR(64)"`
+	C8        string `xorm:"VARCHAR(64)"`
+	C9        string `xorm:"VARCHAR(64)"`
+	C10       string `xorm:"VARCHAR(64)"`
+	C11       string `xorm:"VARCHAR(64)"`
+	C12       string `xorm:"VARCHAR(64)"`
+	C13       string `xorm:"VARCHAR(64)"`
+	C14       string `xorm:"VARCHAR(64)"`
+	C15       string `xorm:"VARCHAR(64)"`
+	C16       string `xorm:"VARCHAR(64)"`
+	C17       string `xorm:"VARCHAR(64)"`
+	C18       string `xorm:"VARCHAR(64)"`
+	C19       string `xorm:"VARCHAR(64)"`
+	C20       string `xorm:"VARCHAR(64)"`
+	D1        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D2        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D3        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D4        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D5        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D6        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D7        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D8        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D9        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D10       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	IsSum     string `xorm:"not null default '0' CHAR(1)"`
+	T1        string `xorm:"MEDIUMTEXT"`
+	T2        string `xorm:"MEDIUMTEXT"`
+}
+
+type DbrSetup struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	SetupType     string `xorm:"comment('설정구분') VARCHAR(18)"`
+	BranchId      int    `xorm:"not null default 0 INT(11)"`
+	SetupCode     string `xorm:"not null VARCHAR(36)"`
+	BrandCode     string `xorm:"not null default '' VARCHAR(16)"`
+	LangType      string `xorm:"not null comment('언어종류') VARCHAR(3)"`
+	SeqNo         int    `xorm:"not null default 0 comment('리스트순서') TINYINT(4)"`
+	SetupName     string `xorm:"not null VARCHAR(36)"`
+	Component     string `xorm:"not null VARCHAR(54)"`
+	Parameter     string `xorm:"not null VARCHAR(54)"`
+	IsOnUse       string `xorm:"not null default '0' CHAR(1)"`
+	IsDefault     string `xorm:"default '0' comment('기본설정여부') CHAR(1)"`
+	IsBrandSelect string `xorm:"default '0' comment('나중에지울것') CHAR(1)"`
+	SetupJson     string `xorm:"TEXT"`
+}
+
+type DbrSgroup struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	AgroupId      int    `xorm:"not null INT(11)"`
+	BranchId      int    `xorm:"not null INT(11)"`
+	Sort          string `xorm:"not null default '0' CHAR(1)"`
+	SgroupCode    string `xorm:"VARCHAR(20)"`
+	SgroupName    string `xorm:"not null VARCHAR(49)"`
+	SgroupType    string `xorm:"VARCHAR(21)"`
+	SgroupManager string `xorm:"VARCHAR(49)"`
+	IsUnused      string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type DbrSorder struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	SorderDate   string `xorm:"not null default '' index(mdx_buyer_date_pro) index CHAR(8)"`
+	SorderNo     string `xorm:"comment('수주번호:자동채번') unique index VARCHAR(21)"`
+	SquoteId     int    `xorm:"index INT(10)"`
+	DealTypeId   int    `xorm:"not null default 1 comment('거래구분:매출(00)-Default') index INT(10)"`
+	UserId       int    `xorm:"not null comment('사용자 id:(5)Default') index INT(10)"`
+	SgroupId     int    `xorm:"not null default 1 comment('영업구분:안경사') index INT(10)"`
+	Sgroup2Id    int    `xorm:"not null default 1 comment('영업구분:판매사') index INT(10)"`
+	BranchId     int    `xorm:"not null default 1 comment('지점:본사(1)Default') index INT(10)"`
+	StorageId    int    `xorm:"not null default 1 comment('창고:본사(1)Default') index INT(10)"`
+	BuyerId      int    `xorm:"not null default 1 comment('고객id') index index(mdx_buyer_date_pro) INT(10)"`
+	VatRateId    int    `xorm:"not null default 1 comment('부가세율:포함(1)Default,별도(0)') index INT(10)"`
+	ProjectId    int    `xorm:"not null default 1 comment('crm 쪽의 프로젝트 연결') index INT(10)"`
+	BuyerContact string `xorm:"comment('고객담당자') VARCHAR(49)"`
+	PayTerms     string `xorm:"comment('지불조건') VARCHAR(69)"`
+	PayPeriod    string `xorm:"comment('지불기간') VARCHAR(69)"`
+	Destination  string `xorm:"comment('도착지역') VARCHAR(69)"`
+	Delivery     string `xorm:"comment('납기') VARCHAR(69)"`
+	Status       string `xorm:"comment('상황:완료(3)') CHAR(1)"`
+	Situation    string `xorm:"comment('안좋은 상황코드(claim등)') CHAR(2)"`
+	IsClosed     string `xorm:"not null comment('종결처리') CHAR(1)"`
+	IsFirstOrder string `xorm:"not null default '0' comment('고객의 첫번째 주문여부') CHAR(1)"`
+	Column1      string `xorm:"VARCHAR(69)"`
+	Column2      string `xorm:"VARCHAR(69)"`
+	Remarks      string `xorm:"TEXT"`
+	Json1        string `xorm:"comment('검안내용') TEXT"`
+	Json2        string `xorm:"comment('현재 사용하지 않음') TEXT"`
+	IsPro        string `xorm:"not null default '0' comment('0:ERP주문, 1:온라인주문') index(mdx_buyer_date_pro) CHAR(1)"`
+	DiscountAmt  string `xorm:"not null default 0.0000 comment('할인금액') DECIMAL(20,4)"`
+	CcardAmt     string `xorm:"not null default 0.0000 comment('신용카드결제액') DECIMAL(20,4)"`
+	CashAmt      string `xorm:"not null default 0.0000 comment('현금결제액') DECIMAL(20,4)"`
+	CouponAmt    string `xorm:"not null default 0.0000 comment('쿠폰결제액') DECIMAL(20,4)"`
+	RewardAmt    string `xorm:"not null default 0.0000 comment('적립금사용액') DECIMAL(20,4)"`
+	CreditUseAmt string `xorm:"not null default 0.0000 comment('충전금사용액') DECIMAL(20,4)"`
+	X1PayAmt     string `xorm:"not null default 0.0000 comment('X1지불금액') DECIMAL(20,4)"`
+	X2PayAmt     string `xorm:"not null default 0.0000 comment('X2지불금액') DECIMAL(20,4)"`
+	IsLocked     string `xorm:"not null default '0' comment('정산완료(1)-수정불가') CHAR(1)"`
+	ShipContact  string `xorm:"comment('연락처명') VARCHAR(64)"`
+	ShipMobile   string `xorm:"comment('배송연락처번호') VARCHAR(21)"`
+	ShipMethod   string `xorm:"comment('배송방식') VARCHAR(32)"`
+	ShipFee      string `xorm:"default 0.0000 comment('배송비') DECIMAL(20,4)"`
+	ShipZipCode  string `xorm:"comment('우편번호') VARCHAR(21)"`
+	ShipAddr1    string `xorm:"comment('주소1') VARCHAR(64)"`
+	ShipAddr2    string `xorm:"comment('주소2') VARCHAR(64)"`
+	ShipNotes    string `xorm:"comment('배송메모') VARCHAR(64)"`
+	Paymethod    string `xorm:"not null default '0' comment('결재방식(shop-pay-method setup과 연동)') VARCHAR(16)"`
+	RemitAccount string `xorm:"comment('송금받는계좌') VARCHAR(64)"`
+	RemitName    string `xorm:"comment('무통장입금자명') VARCHAR(32)"`
+	Ip           string `xorm:"VARCHAR(20)"`
+}
+
+type EthBlock struct {
+	Id          int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	BlockNo     int    `xorm:"default 0 unique(idx_block_no) INT(11)"`
+	BlockHash   string `xorm:"index unique(idx_block_no) VARCHAR(68)"`
+	TxnCnt      int    `xorm:"default 0 comment('트랜잭션 갯수') INT(11)"`
+	UncleCnt    int    `xorm:"default 0 comment('엉클블록 갯수') INT(11)"`
+	Miner       string `xorm:"comment('채굴 Account Address') VARCHAR(50)"`
+	GasUsed     string `xorm:"comment('개스 사용여부 0:아님, 1.:사용') DECIMAL(11)"`
+	GasLimit    string `xorm:"DECIMAL(11)"`
+	TrfeeSum    string `xorm:"comment('트랜잭션 fee 합계') DECIMAL(32)"`
+	Reward      string `xorm:"comment('블록 보상액') DECIMAL(32)"`
+	UncleReward string `xorm:"default 0 comment('엉클블록 보상액') DECIMAL(32)"`
+	Status      int    `xorm:"default 0 comment('비정상:0, 정상:1') SMALLINT(6)"`
+}
+
+type DbrSorderBd struct {
+	Id           int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	SorderId     int    `xorm:"not null default 0 index INT(10)"`
+	SquoteBdId   int    `xorm:"not null default 0 index INT(10)"`
+	SeqNo        int    `xorm:"not null default 0 TINYINT(4)"`
+	ItemId       int    `xorm:"not null default 0 index INT(10)"`
+	SorderQty    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	SorderPrc    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	CurrPurchPrc string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	CurrSalesPrc string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	SorderSupply string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	SorderVat    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	SorderSum    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	DiscountRate string `xorm:"default 0.0000 DECIMAL(6,4)"`
+	Ref1         string `xorm:"VARCHAR(69)"`
+	Ref2         string `xorm:"VARCHAR(69)"`
+	SorderMemo   string `xorm:"TEXT"`
+	SorderDesc   string `xorm:"TEXT"`
+	IsEnd        string `xorm:"not null default '0' CHAR(4)"`
+	DeliDate     string `xorm:"CHAR(8)"`
+	ConfirmDate  string `xorm:"CHAR(8)"`
+	CartId       int    `xorm:"not null default 0 comment('연결된 cart 삭제용') INT(11)"`
+	Ip           string `xorm:"VARCHAR(20)"`
+}
+
+type DbrSorderBdShip struct {
+	Id          int    `xorm:"not null pk autoincr INT(11)"`
+	UploadBatch string `xorm:"not null default '' comment('업로드 1회처리 모음') VARCHAR(21)"`
+	CreatedOn   int64  `xorm:"not null default unix_timestamp() BIGINT(11)"`
+	UpdatedOn   int64  `xorm:"not null default unix_timestamp() BIGINT(11)"`
+	SorderBdId  int    `xorm:"not null default 0 index INT(11)"`
+	ShipDate    string `xorm:"not null default '' comment('배송일자') CHAR(8)"`
+	CourierCode string `xorm:"not null default '' comment('배송업체코드') VARCHAR(21)"`
+	InvoiceNo   string `xorm:"not null default '' comment('배송장번호') VARCHAR(32)"`
+	Sort        string `xorm:"not null default '0' comment('0:전체배송, 1:분할배송, 2:타배송통합') CHAR(1)"`
+	Status      string `xorm:"not null default '0' comment('0:발송, 1:출발물류센터, 2:통관, 3:도착물류센터, 4:도착지배송중, 5:배송완료') CHAR(1)"`
+	ShipDesc    string `xorm:"comment('배송분할 및 내부내역') TEXT"`
+	Ip          string `xorm:"VARCHAR(20)"`
+}
+
+type DbrSortMenu struct {
+	Id          int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn   int64  `xorm:"not null default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"not null default 0 BIGINT(20)"`
+	MenuCode    string `xorm:"not null default '' comment('메뉴코드') VARCHAR(10)"`
+	SortType    string `xorm:"not null default '' comment('소트구분') VARCHAR(16)"`
+	BgcolorCode string `xorm:"not null default '' comment('메뉴배경색상') VARCHAR(10)"`
+	DashPageUrl string `xorm:"not null default '' comment('DashboardPageURL') VARCHAR(100)"`
+	Icon        string `xorm:"not null default '0' VARCHAR(69)"`
+	IsEnabled   string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type DbrSquote struct {
+	Id             int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	SquoteNo       string `xorm:"not null comment('견적번호') unique VARCHAR(21)"`
+	SquoteDate     string `xorm:"not null comment('견적일자') VARCHAR(8)"`
+	DealTypeId     int    `xorm:"not null comment('거래구분') INT(10)"`
+	UserId         int    `xorm:"not null comment('사용자') INT(10)"`
+	SgroupId       int    `xorm:"default 0 INT(10)"`
+	BranchId       int    `xorm:"not null comment('지사구분') INT(10)"`
+	BuyerId        int    `xorm:"not null comment('매출업체') INT(10)"`
+	VatRateId      int    `xorm:"not null comment('부가세구분') INT(10)"`
+	CompanyContact string `xorm:"comment('업체주담당자') VARCHAR(49)"`
+	PayTerms       string `xorm:"comment('지불조건') VARCHAR(69)"`
+	PayPeriod      string `xorm:"comment('지불기한') VARCHAR(69)"`
+	Destination    string `xorm:"comment('납품장소') VARCHAR(69)"`
+	Delivery       string `xorm:"comment('납품기한') VARCHAR(69)"`
+	Status         string `xorm:"comment('상태') CHAR(1)"`
+	IsClosed       string `xorm:"not null comment('종결여부') CHAR(1)"`
+	Column1        string `xorm:"comment('추가정보1') VARCHAR(69)"`
+	Column2        string `xorm:"comment('추가정보2') VARCHAR(69)"`
+	Remarks        string `xorm:"comment('비고') TEXT"`
+	Ip             string `xorm:"comment('입력IP') VARCHAR(20)"`
+}
+
+type DbrSquoteBd struct {
+	Id           int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	SquoteId     int    `xorm:"not null comment('견적헤드ID') INT(10)"`
+	SeqNo        int    `xorm:"not null comment('순서') TINYINT(4)"`
+	ItemId       int    `xorm:"not null comment('품목') INT(10)"`
+	SquoteQty    string `xorm:"not null default 0.0000 comment('수량') DECIMAL(20,4)"`
+	SquotePrc    string `xorm:"not null default 0.0000 comment('단가') DECIMAL(20,4)"`
+	SquoteSupply string `xorm:"not null default 0.0000 comment('공급가액') DECIMAL(20,4)"`
+	SquoteVat    string `xorm:"not null default 0.0000 comment('부가세액') DECIMAL(20,4)"`
+	SquoteSum    string `xorm:"not null default 0.0000 comment('합계금액') DECIMAL(20,4)"`
+	DiscountRate string `xorm:"not null default 0.0000 comment('할인율') DECIMAL(6,4)"`
+	DeliDate     string `xorm:"comment('요청납기') VARCHAR(8)"`
+	ConfirmDate  string `xorm:"comment('확정납기') VARCHAR(8)"`
+	Ref1         string `xorm:"comment('옵션1') VARCHAR(69)"`
+	Ref2         string `xorm:"comment('옵션2') VARCHAR(69)"`
+	SquoteMemo   string `xorm:"comment('품목상세') TEXT"`
+	SquoteDesc   string `xorm:"comment('품목설명') TEXT"`
+	Ip           string `xorm:"comment('입력IP') VARCHAR(20)"`
+}
+
+type DbrStockIo struct {
+	Id              int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn       int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn       int64  `xorm:"default 0 BIGINT(20)"`
+	SlipCode        string `xorm:"not null default '' CHAR(5)"`
+	SlipBdId        int    `xorm:"not null INT(10)"`
+	SlipNo          string `xorm:"not null VARCHAR(21)"`
+	SeqNo           int    `xorm:"not null TINYINT(4)"`
+	IoDate          string `xorm:"not null CHAR(8)"`
+	DealTypeId      int    `xorm:"not null INT(10)"`
+	StorageId       int    `xorm:"not null INT(10)"`
+	CompanyId       int    `xorm:"not null INT(10)"`
+	VatRateId       int    `xorm:"not null INT(10)"`
+	ItemId          int    `xorm:"not null default 0 INT(10)"`
+	IoQty           string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	IoPrc           string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	IoSupply        string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	IoVat           string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	IoSum           string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	MaterialCostPrc string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	LaborCostPrc    string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	ExpenseCostPrc  string `xorm:"default 0.0000 DECIMAL(20,4)"`
+}
+
+type DbrStorage struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	StorageCode   string `xorm:"not null unique VARCHAR(20)"`
+	StorageName   string `xorm:"VARCHAR(49)"`
+	Location      string `xorm:"VARCHAR(49)"`
+	IsMainStorage string `xorm:"default '0' CHAR(1)"`
+	IsBadStorage  string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type DbrTextTemplate struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	TextCode  string `xorm:"not null VARCHAR(21)"`
+	TextName  string `xorm:"not null VARCHAR(36)"`
+	Sort      string `xorm:"default '1' CHAR(1)"`
+	TextTitle string `xorm:"VARCHAR(45)"`
+	MainText  string `xorm:"not null MEDIUMTEXT"`
+	MmsImages string `xorm:"MEDIUMTEXT"`
+}
+
+type DbrUserExt struct {
+	Id          int    `xorm:"not null pk INT(10)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	MobileNo    string `xorm:"VARCHAR(20)"`
+	PhoneNo     string `xorm:"VARCHAR(20)"`
+	UserPermId  int    `xorm:"not null INT(11)"`
+	MenuLangSw  int    `xorm:"not null TINYINT(4)"`
+	SgroupId    int    `xorm:"not null INT(11)"`
+	BranchId    int    `xorm:"not null INT(11)"`
+	StorageId   int    `xorm:"not null INT(10)"`
+	AgroupId    int    `xorm:"not null INT(11)"`
+	CountryCode string `xorm:"not null CHAR(5)"`
+	IsExpired   string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type DbrUserMenu struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	SortType     string `xorm:"not null default 'erp' comment('소트메뉴 타입') VARCHAR(12)"`
+	MenuCode     string `xorm:"VARCHAR(10)"`
+	MenuLang0    string `xorm:"comment('메뉴명') VARCHAR(64)"`
+	PageUri      string `xorm:"VARCHAR(100)"`
+	ParaName     string `xorm:"VARCHAR(100)"`
+	ThemeDir     string `xorm:"VARCHAR(100)"`
+	IsSkipped    string `xorm:"not null default '0' comment('메뉴보이지 않음') CHAR(1)"`
+	MainAppId    int    `xorm:"not null default 0 comment('메인앱') INT(10)"`
+	GuestAppId   int    `xorm:"not null default 0 comment('게스트앱') INT(10)"`
+	MenuLang1    string `xorm:"VARCHAR(100)"`
+	MenuLang2    string `xorm:"VARCHAR(100)"`
+	MenuLang3    string `xorm:"VARCHAR(100)"`
+	ManualUri    string `xorm:"VARCHAR(191)"`
+	Icon         string `xorm:"VARCHAR(69)"`
+	DisableLMenu string `xorm:"default '0' CHAR(1)"`
+	EnableRMenu  string `xorm:"default '0' CHAR(1)"`
+}
+
+type DbrVatRate struct {
+	Id             int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	SortNo         int    `xorm:"not null default 0 TINYINT(4)"`
+	VatName        string `xorm:"VARCHAR(21)"`
+	IsIncluded     string `xorm:"not null default '0' CHAR(4)"`
+	VatRate        string `xorm:"not null DECIMAL(4,2)"`
+	IsSalesDefault string `xorm:"not null default '0' CHAR(1)"`
+	IsPurchDefault string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type ProCart struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	MemberBuyerId int    `xorm:"not null default 0 index INT(10)"`
+	ItemId        int    `xorm:"not null default 0 index INT(10)"`
+	GoDetailsId   int    `xorm:"not null default 0 comment('디테일이동품목id') index INT(10)"`
+	GoDetailsSlug string `xorm:"not null default '' comment('이동품목 slug(style의 경우도 고려)') VARCHAR(128)"`
+	CartQty       string `xorm:"not null default 0.0000 DECIMAL(20,4)"`
+	Column1       string `xorm:"not null default '' VARCHAR(49)"`
+	Column2       string `xorm:"not null default '' VARCHAR(49)"`
+	CartDesc      string `xorm:"not null default '' TEXT"`
+	Checked       string `xorm:"not null default '0' comment('Cart Check') CHAR(1)"`
+	Ip            string `xorm:"VARCHAR(21)"`
+}
+
+type EthContractSol struct {
+	Id        int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	CntrAddr  string `xorm:"VARCHAR(64)"`
+	CntrId    int    `xorm:"not null INT(11)"`
+	MemberId  int    `xorm:"INT(11)"`
+	FileName  string `xorm:"VARCHAR(256)"`
+	SolCode   string `xorm:"comment('솔리디티 코드') MEDIUMTEXT"`
+	Ip        string `xorm:"VARCHAR(20)"`
+}
+
+type EthCirculSum struct {
+	Id             int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn      int64  `xorm:"not null comment('해당일-Unixtime') BIGINT(20)"`
+	SumDate        string `xorm:"default '' comment('집계일자:sum_date+erc_type+cntr_addr->uniqueKey') CHAR(8)"`
+	ErcType        string `xorm:"not null default '0' comment('main, erc20, erc721, erc1155') VARCHAR(10)"`
+	CntrAddr       string `xorm:"not null default '' comment('main 또는 컨트렉트 주소') VARCHAR(64)"`
+	DailyCirculSum string `xorm:"not null default 0 comment('일유통량') DECIMAL(34)"`
+	AddBlockCnt    int64  `xorm:"default 0 comment('추가된 블록수') BIGINT(20)"`
+	RewardSum      string `xorm:"default 0.0000000 comment('보상합계') DECIMAL(23,7)"`
+	AccRewardSum   string `xorm:"default 0.0000000 comment('계정별 보상합계') DECIMAL(23,7)"`
+	TxnCnt         int    `xorm:"default 0 comment('트랜잭션 갯수') INT(11)"`
+	TxnFailCnt     int    `xorm:"default 0 comment('실패한트랜잭션 갯수') INT(11)"`
+}
+
+type EthContract struct {
+	Id          int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	TxnHash     string `xorm:"unique VARCHAR(66)"`
+	BlockNo     int64  `xorm:"BIGINT(11)"`
+	CntrAddr    string `xorm:"comment('main or 컨트랙트 주소') unique VARCHAR(64)"`
+	CreatorAddr string `xorm:"VARCHAR(64)"`
+	Balance     string `xorm:"default 0 DECIMAL(16)"`
+	TxnCnt      int    `xorm:"default 0 INT(11)"`
+	OrderBy     int    `xorm:"not null default 0 comment('리스트 순서') TINYINT(4)"`
+}
+
+type EthContractAbi struct {
+	Id         int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	CntrAddr   string `xorm:"comment('컨트랙트 주소') VARCHAR(64)"`
+	CntrId     int    `xorm:"not null INT(11)"`
+	MemberId   int    `xorm:"INT(11)"`
+	CntrName   string `xorm:"not null VARCHAR(64)"`
+	Compiler   string `xorm:"VARCHAR(64)"`
+	Version    string `xorm:"VARCHAR(64)"`
+	Veried     string `xorm:"VARCHAR(64)"`
+	License    string `xorm:"comment('소유자 입력') VARCHAR(64)"`
+	AbiCode    string `xorm:"comment('사용abi 코드 입력') MEDIUMTEXT"`
+	CreateCode string `xorm:"not null comment('사용코드 입력') MEDIUMTEXT"`
+	Ip         string `xorm:"VARCHAR(20)"`
+}
+
+type LogBranchClosing struct {
+	Id             int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	BranchId       int    `xorm:"not null default 0 INT(10)"`
+	ClosingDate    string `xorm:"not null default '' comment('정산일자') CHAR(8)"`
+	UserIdRun      int    `xorm:"not null INT(10)"`
+	UserIdApproved int    `xorm:"not null INT(10)"`
+	PosClosingId   int    `xorm:"not null INT(10)"`
+	IsPos          string `xorm:"not null default '0' comment('POS마감') CHAR(1)"`
+	IsSales        string `xorm:"not null default '0' comment('매출마감') CHAR(1)"`
+	IsPurch        string `xorm:"not null default '0' comment('매입마감') CHAR(1)"`
+	IsStock        string `xorm:"not null default '0' comment('재고수불마감') CHAR(1)"`
+	IsAccount      string `xorm:"not null default '0' comment('회계마감') CHAR(1)"`
+	IsReward       string `xorm:"not null default '0' comment('적립금마감') CHAR(1)"`
+	IsCredit       string `xorm:"not null default '0' comment('충전금마감') CHAR(1)"`
+	RemoteIp       string `xorm:"VARCHAR(16)"`
+	FrontIp        string `xorm:"VARCHAR(16)"`
+}
+
+type LogProcedureRun struct {
+	Id               int       `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn        int64     `xorm:"default 0 BIGINT(20)"`
+	LogToken         string    `xorm:"not null VARCHAR(21)"`
+	TokenSeqNo       int       `xorm:"not null default 0 TINYINT(4)"`
+	LogDate          time.Time `xorm:"not null default current_timestamp() DATETIME"`
+	CallingProcedure string    `xorm:"VARCHAR(128)"`
+	ProcedureName    string    `xorm:"VARCHAR(128)"`
+	Parameters       string    `xorm:"VARCHAR(256)"`
+	ResultCode       string    `xorm:"CHAR(1)"`
+	ReturnValue      string    `xorm:"MEDIUMTEXT"`
+}
+
+type MainApi23App struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	DeletedOn int64  `xorm:"BIGINT(20)"`
+	AppNo     string `xorm:"VARCHAR(21)"`
+	AppDate   string `xorm:"CHAR(8)"`
+	MemberId  int    `xorm:"not null INT(10)"`
+	AppType   string `xorm:"VARCHAR(30)"`
+	AppName   string `xorm:"VARCHAR(100)"`
+	OriginUrl string `xorm:"VARCHAR(300)"`
+	Api23Key  string `xorm:"VARCHAR(512)"`
+	Ip        string `xorm:"VARCHAR(20)"`
+}
+
+type MainSsoApp struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	DeletedOn    int64  `xorm:"BIGINT(20)"`
+	SsoAppNo     string `xorm:"VARCHAR(21)"`
+	SsoAppDate   string `xorm:"CHAR(8)"`
+	MemberId     int    `xorm:"not null INT(10)"`
+	AppType      string `xorm:"VARCHAR(30)"`
+	AppName      string `xorm:"VARCHAR(100)"`
+	ClientId     string `xorm:"VARCHAR(100)"`
+	ClientSecret string `xorm:"VARCHAR(100)"`
+	OriginUri    string `xorm:"VARCHAR(300)"`
+	RedirectUri  string `xorm:"VARCHAR(300)"`
+	IsDaboryApp  int    `xorm:"not null default 0 TINYINT(4)"`
+	DbrKeyPair   string `xorm:"VARCHAR(100)"`
+	AppBase64    string `xorm:"VARCHAR(512)"`
+}
+
+type MainSsoAppBd struct {
+	Id          int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	SsoAppId    int    `xorm:"not null INT(10)"`
+	SeqNo       int    `xorm:"not null TINYINT(4)"`
+	PublicKey   string `xorm:"VARCHAR(100)"`
+	MemberId    int    `xorm:"not null INT(10)"`
+	AppBase64   string `xorm:"VARCHAR(512)"`
+	Ab64Desc    string `xorm:"VARCHAR(128)"`
+	IsDiscarded string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type MainSsoAppLog struct {
+	Id          int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	AppId       int    `xorm:"not null INT(11)"`
+	UserId      int    `xorm:"not null INT(11)"`
+	IpAddress   string `xorm:"VARCHAR(30)"`
+	AccessToken string `xorm:"TEXT"`
+}
+
+type ProAppApi struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	ApiCode      string `xorm:"VARCHAR(10)"`
+	ApiUri       string `xorm:"VARCHAR(128)"`
+	QueryName    string `xorm:"VARCHAR(128)"`
+	ApiDesc      string `xorm:"VARCHAR(69)"`
+	IsDeprecated string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type ProAppGuest struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	AppName   string `xorm:"VARCHAR(64)"`
+	ApiUri    string `xorm:"VARCHAR(512)"`
+	AppBase64 string `xorm:"VARCHAR(128)"`
+	IsOnUse   string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type ProAppPerm struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	PermNo    string `xorm:"VARCHAR(21)"`
+	PermDate  string `xorm:"CHAR(8)"`
+	PermName  string `xorm:"VARCHAR(50)"`
+	PermDesc  string `xorm:"VARCHAR(200)"`
+}
+
+type ProAppPermBd struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	AppPermId int    `xorm:"not null INT(10)"`
+	AppApiId  int    `xorm:"not null INT(10)"`
+	IsUse     string `xorm:"not null CHAR(1)"`
+}
+
+type ProCompanyContactBd struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	MemberBuyerId int    `xorm:"not null comment('로그인회원-고객id') INT(11)"`
+	SeqNo         int    `xorm:"not null default 0 comment('순서') TINYINT(4)"`
+	Sort          string `xorm:"not null default '0' comment('종류') CHAR(1)"`
+	ContactName   string `xorm:"comment('연락처명') VARCHAR(64)"`
+	MobileNo      string `xorm:"comment('모바일번호') VARCHAR(32)"`
+}
+
+type ProCompanyCrcardBd struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	CompanyId  int    `xorm:"not null INT(10)"`
+	SeqNo      int    `xorm:"not null default 0 comment('순서') TINYINT(4)"`
+	CardNo     string `xorm:"comment('카드번호') VARCHAR(21)"`
+	HolderName string `xorm:"comment('소유자명') VARCHAR(49)"`
+}
+
+type ProCompanyDestinaBd struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	MemberBuyerId int    `xorm:"not null comment('로그인회원-고객id') INT(11)"`
+	SeqNo         int    `xorm:"not null default 0 comment('순서') TINYINT(4)"`
+	Sort          string `xorm:"not null default '0' comment('종류') CHAR(1)"`
+	ZipCode       string `xorm:"comment('우편번호') VARCHAR(21)"`
+	Addr1         string `xorm:"comment('주소1') VARCHAR(64)"`
+	Addr2         string `xorm:"comment('주소2') VARCHAR(64)"`
+}
+
+type ProGuestLog struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	LogDate    string `xorm:"VARCHAR(8)"`
+	CurrentUrl string `xorm:"VARCHAR(1000)"`
+	RefererUrl string `xorm:"not null VARCHAR(1000)"`
+	MemberId   int    `xorm:"not null INT(10)"`
+	Ip         string `xorm:"VARCHAR(21)"`
+}
+
+type ProItemBadge struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"not null default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"not null default 0 BIGINT(20)"`
+	Sort       string `xorm:"not null default '' comment('뱃지종류') VARCHAR(6)"`
+	BadgeCode  string `xorm:"not null comment('뱃지 코드') VARCHAR(30)"`
+	BadgeName  string `xorm:"not null default '' comment('뱃지명') VARCHAR(6)"`
+	LangType   string `xorm:"not null default '' comment('언어구분') VARCHAR(3)"`
+	DeviceType string `xorm:"not null default '' comment('기기구분') VARCHAR(10)"`
+	BadgeType  string `xorm:"not null default '' comment('뱃지타입') VARCHAR(3)"`
+	CssClass   string `xorm:"not null default '' comment('태그이름') VARCHAR(32)"`
+	XPos       int    `xorm:"not null default 3 comment('x축위치') TINYINT(4)"`
+	YPos       int    `xorm:"not null default 3 comment('y축위치') TINYINT(4)"`
+	IsHide     string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type ProItemBadpro struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"not null default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"not null default 0 BIGINT(20)"`
+	ItemId    int    `xorm:"not null comment('품목 id') INT(11)"`
+	SeqNo     int    `xorm:"not null default 0 comment('순서') TINYINT(4)"`
+	BadgeCode string `xorm:"not null default '' comment('뱃지코드') VARCHAR(30)"`
+	Ip        string `xorm:"not null default '' VARCHAR(21)"`
+}
+
+type ProItemRelated struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"not null default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"not null default 0 BIGINT(20)"`
+	ItemId        int    `xorm:"not null comment('품목 id') INT(11)"`
+	SeqNo         int    `xorm:"not null default 0 comment('순서') TINYINT(4)"`
+	ItemRelatedId int    `xorm:"not null default 1 comment('관련품목 id') INT(11)"`
+	Ip            string `xorm:"not null default '' VARCHAR(21)"`
+}
+
+type ProItemTaxo struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	ItemTaxoNo string `xorm:"comment('분류번호') unique VARCHAR(21)"`
+	UserId     int    `xorm:"not null comment('사용자') INT(10)"`
+	BranchId   int    `xorm:"not null comment('지사구분') INT(10)"`
+	TaxoDate   string `xorm:"comment('분류일자') CHAR(8)"`
+	TaxoName   string `xorm:"comment('분류명') VARCHAR(50)"`
+	Remarks    string `xorm:"comment('분류설명') TEXT"`
+}
+
+type ProItemTaxoBd struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	ItemTaxoId int    `xorm:"not null comment('품목분류ID') INT(10)"`
+	SeqNo      int    `xorm:"not null default 0 comment('순서') TINYINT(4)"`
+	ItemId     int    `xorm:"not null comment('품목ID') INT(10)"`
+	IsSkipped  string `xorm:"not null comment('표시않음') CHAR(1)"`
+}
+
+type ProMainMenu struct {
+	Id         int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	Sort       string `xorm:"not null default '' comment('primary, top, footer, site-map') VARCHAR(12)"`
+	MenuCode   string `xorm:"VARCHAR(10)"`
+	LangType   string `xorm:"not null default '''''' comment('언어구분') VARCHAR(3)"`
+	DeviceType string `xorm:"not null default '''''' comment('디바이스구분') VARCHAR(10)"`
+	MenuName   string `xorm:"not null default '' comment('메인 메뉴명') VARCHAR(64)"`
+	LinkType   string `xorm:"not null default '0' comment('0:일반페이지, 1:품목분류, 2:게시판') CHAR(1)"`
+	TypeCode   string `xorm:"not null default '' comment('1:품목분류코두 2:게시판구분코드') VARCHAR(32)"`
+	PageUri    string `xorm:"not null default '' comment('직접지정 Uri') VARCHAR(516)"`
+	Icon       string `xorm:"not null default '' comment('아이콘') VARCHAR(69)"`
+	MenuImg    string `xorm:"not null default '' comment('메뉴이미지') VARCHAR(128)"`
+	BreadCrumb string `xorm:"not null default '' comment('빵부스러기 길') TEXT"`
+	Status     string `xorm:"not null default '' comment('all, login-only, logout-only') VARCHAR(12)"`
+	IsSkipped  string `xorm:"not null default '0' comment('사용않음') CHAR(1)"`
+}
+
+type ProMember struct {
+	Id            int    `xorm:"not null pk autoincr unique INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	DeletedOn     int64  `xorm:"BIGINT(20)"`
+	ActivatedOn   int64  `xorm:"BIGINT(20)"`
+	LastSeenOn    int64  `xorm:"BIGINT(20)"`
+	LastLoginOn   int64  `xorm:"BIGINT(20)"`
+	MemberDate    string `xorm:"VARCHAR(8)"`
+	Email         string `xorm:"not null unique VARCHAR(64)"`
+	Password      string `xorm:"not null VARCHAR(128)"`
+	LoginId       string `xorm:"comment('login_id 사용하는경우') VARCHAR(64)"`
+	SsoBrand      string `xorm:"VARCHAR(64)"`
+	SsoSub        string `xorm:"VARCHAR(64)"`
+	ActivateCode  string `xorm:"index VARCHAR(32)"`
+	ResetCode     string `xorm:"default 'MD5(RAND())' VARCHAR(32)"`
+	NickName      string `xorm:"VARCHAR(128)"`
+	FirstName     string `xorm:"VARCHAR(128)"`
+	SurName       string `xorm:"VARCHAR(128)"`
+	IsActivated   string `xorm:"default '0' CHAR(1)"`
+	IsGuest       string `xorm:"not null default '0' CHAR(1)"`
+	ProfileImg    string `xorm:"VARCHAR(256)"`
+	ProfileWeb    string `xorm:"comment('소셜 페이지등') VARCHAR(256)"`
+	ProfileText   string `xorm:"VARCHAR(255)"`
+	CreatedIp     string `xorm:"VARCHAR(21)"`
+	Sort          string `xorm:"default '0' CHAR(1)"`
+	Status        string `xorm:"default '0' CHAR(1)"`
+	BuyerId       int    `xorm:"INT(11)"`
+	SgroupId      int    `xorm:"not null default 1 INT(11)"`
+	SgroupCode    string `xorm:"VARCHAR(20)"`
+	LastLoginIp   string `xorm:"VARCHAR(21)"`
+	IsWithdrawn   string `xorm:"default '0' CHAR(1)"`
+	SsoSubId      int    `xorm:"not null default 0 INT(11)"`
+	IsMemberApp   string `xorm:"not null default '0' CHAR(1)"`
+	DormantMailOn int64  `xorm:"not null default 0 comment('휴면계정메일보낸 날짜') BIGINT(20)"`
+	WithdrawOn    int    `xorm:"not null default 0 comment('탈퇴일') INT(11)"`
+	HashedIndex   string `xorm:"default '' comment('휴면계정여부 확인용') index VARCHAR(32)"`
+}
+
+type ProMemberApp struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	SsoSubId  int    `xorm:"not null default 0 INT(11)"`
+	AppPermId int    `xorm:"not null INT(11)"`
+	SgroupId  int    `xorm:"not null INT(11)"`
+	BranchId  int    `xorm:"not null INT(11)"`
+	StorageId int    `xorm:"not null INT(11)"`
+	AgroupId  int    `xorm:"not null INT(11)"`
+	IsExpired string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type ProMemberDormant struct {
+	Id            int    `xorm:"not null pk INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	DeletedOn     int64  `xorm:"BIGINT(20)"`
+	Email         string `xorm:"not null unique VARCHAR(64)"`
+	LoginId       string `xorm:"not null VARCHAR(64)"`
+	SsoBrand      string `xorm:"VARCHAR(64)"`
+	SsoSub        string `xorm:"VARCHAR(64)"`
+	NickName      string `xorm:"VARCHAR(128)"`
+	FirstName     string `xorm:"VARCHAR(128)"`
+	SurName       string `xorm:"VARCHAR(128)"`
+	ProfileImg    string `xorm:"not null VARCHAR(256)"`
+	ProfileWeb    string `xorm:"not null VARCHAR(256)"`
+	ProfileText   string `xorm:"VARCHAR(255)"`
+	Sort          string `xorm:"default '0' CHAR(1)"`
+	Status        string `xorm:"default '0' CHAR(1)"`
+	BuyerId       int    `xorm:"INT(11)"`
+	SgroupIdRecom int    `xorm:"not null default 0 INT(11)"`
+	SgroupCode    string `xorm:"VARCHAR(20)"`
+	SsoSubId      int    `xorm:"not null default 0 INT(11)"`
+	IsMemberApp   string `xorm:"not null default '0' CHAR(1)"`
+	ExtFromHere   string `xorm:"not null default '' CHAR(1)"`
+	MobileNo      string `xorm:"VARCHAR(20)"`
+	PhoneNo       string `xorm:"VARCHAR(20)"`
+	MemberPermId  int    `xorm:"not null INT(11)"`
+	MenuLangSw    int    `xorm:"not null TINYINT(4)"`
+	SgroupId      int    `xorm:"not null INT(11)"`
+	BranchId      int    `xorm:"not null INT(11)"`
+	StorageId     int    `xorm:"not null INT(11)"`
+	AgroupId      int    `xorm:"not null INT(11)"`
+	CountryCode   string `xorm:"not null CHAR(5)"`
+}
+
+type ProMemberExt struct {
+	Id           int    `xorm:"not null pk INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	MobileNo     string `xorm:"VARCHAR(20)"`
+	PhoneNo      string `xorm:"VARCHAR(20)"`
+	MemberPermId int    `xorm:"not null INT(11)"`
+	MenuLangSw   int    `xorm:"not null TINYINT(4)"`
+	SgroupId     int    `xorm:"not null INT(11)"`
+	BranchId     int    `xorm:"not null INT(11)"`
+	StorageId    int    `xorm:"not null INT(11)"`
+	AgroupId     int    `xorm:"not null INT(11)"`
+	CountryCode  string `xorm:"not null CHAR(5)"`
+	IsExpired    string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type ProMemberMenu struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	MenuCode     string `xorm:"VARCHAR(10)"`
+	MenuLang0    string `xorm:"comment('메뉴명') VARCHAR(64)"`
+	PageUri      string `xorm:"VARCHAR(100)"`
+	ParaName     string `xorm:"VARCHAR(100)"`
+	ThemeDir     string `xorm:"VARCHAR(100)"`
+	IsSkipped    string `xorm:"not null default '0' comment('메뉴보이지 않음') CHAR(1)"`
+	MainAppId    int    `xorm:"not null default 0 comment('메인앱') INT(10)"`
+	GuestAppId   int    `xorm:"not null default 0 comment('게스트앱') INT(10)"`
+	MenuLang1    string `xorm:"VARCHAR(100)"`
+	MenuLang2    string `xorm:"VARCHAR(100)"`
+	MenuLang3    string `xorm:"VARCHAR(100)"`
+	ManualUri    string `xorm:"VARCHAR(191)"`
+	Icon         string `xorm:"VARCHAR(69)"`
+	DisableLMenu string `xorm:"default '0' CHAR(1)"`
+	EnableRMenu  string `xorm:"default '0' CHAR(1)"`
+}
+
+type ProMemberPerm struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	PermNo    string `xorm:"VARCHAR(21)"`
+	PermDate  string `xorm:"CHAR(8)"`
+	PermName  string `xorm:"VARCHAR(50)"`
+	PermDesc  string `xorm:"VARCHAR(200)"`
+}
+
+type ProMemberPermBd struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	MemberPermId int    `xorm:"not null INT(10)"`
+	MemberMenuId int    `xorm:"not null INT(10)"`
+	IsUse        string `xorm:"not null CHAR(1)"`
+	IsMymenu     string `xorm:"not null default '0' CHAR(1)"`
+	IsList       string `xorm:"not null CHAR(1)"`
+	IsRead       string `xorm:"not null CHAR(1)"`
+	IsCreate     string `xorm:"not null CHAR(1)"`
+	IsUpdate     string `xorm:"not null CHAR(1)"`
+	IsDelete     string `xorm:"not null CHAR(1)"`
+	IsNewtab     string `xorm:"not null default '0' CHAR(1)"`
+}
+
+type ProPost struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	PostNo        string `xorm:"not null default '' comment('FormB용 자동번호') unique VARCHAR(21)"`
+	ListOrder     int    `xorm:"not null default 0 comment('리스트 순서') INT(11)"`
+	OfficialDate  string `xorm:"comment('공식기록일자') CHAR(8)"`
+	OfficialTime  string `xorm:"comment('공식기록 시간') CHAR(8)"`
+	MemberId      int    `xorm:"not null default 0 INT(11)"`
+	UserId        int    `xorm:"default 0 INT(11)"`
+	PostTypeId    int    `xorm:"comment('게시판 종류') INT(11)"`
+	MediaId       int    `xorm:"not null default 1 comment('미디어라이브러리') INT(11)"`
+	PostTitle     string `xorm:"comment('글제목') TEXT"`
+	PostContents  string `xorm:"comment('상세내용-html') MEDIUMTEXT"`
+	PostExcerpt   string `xorm:"comment('내용축약') TEXT"`
+	Status        string `xorm:"CHAR(1)"`
+	Sort          string `xorm:"CHAR(1)"`
+	Pc1           string `xorm:"comment('추가필드-varchar') VARCHAR(64)"`
+	Pc2           string `xorm:"VARCHAR(64)"`
+	Pc3           string `xorm:"VARCHAR(64)"`
+	Pc4           string `xorm:"VARCHAR(64)"`
+	Pc5           string `xorm:"VARCHAR(64)"`
+	Pc6           string `xorm:"VARCHAR(64)"`
+	Pc7           string `xorm:"VARCHAR(64)"`
+	Pc8           string `xorm:"VARCHAR(64)"`
+	Pc9           string `xorm:"VARCHAR(64)"`
+	Pc10          string `xorm:"VARCHAR(64)"`
+	Pd1           string `xorm:"default 0.0000 comment('금액필드-decimal') DECIMAL(20,4)"`
+	Pd2           string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd3           string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd4           string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd5           string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd6           string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd7           string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd8           string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd9           string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pd10          string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	Pt1           string `xorm:"comment('추가필드-text') TEXT"`
+	Pt2           string `xorm:"TEXT"`
+	Guid          string `xorm:"comment('사용않음') VARCHAR(255)"`
+	PostPassword  string `xorm:"VARCHAR(255)"`
+	PostMimeType  string `xorm:"VARCHAR(100)"`
+	CommentStatus string `xorm:"VARCHAR(20)"`
+	CommentCnt    int    `xorm:"comment('댓글갯수') INT(11)"`
+	ParentId      int    `xorm:"comment('부모글id') INT(11)"`
+	Ip            string `xorm:"VARCHAR(20)"`
+	Duid          string `xorm:"default '' comment('API 클러스터용 UUID') CHAR(36)"`
+	PostSlug      string `xorm:"not null default '' comment('게시판슬러그') unique VARCHAR(128)"`
+	PostMeta      string `xorm:"not null comment('게시판Seo-Meta') TEXT"`
+}
+
+type ZdbSorder struct {
+	TId       int    `xorm:"not null pk autoincr unique INT(10)"`
+	Id        int    `xorm:"INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"VARCHAR(21)"`
+	OrderBy   string `xorm:"VARCHAR(32)"`
+	C1        string `xorm:"VARCHAR(200)"`
+	C2        string `xorm:"VARCHAR(200)"`
+	C3        string `xorm:"VARCHAR(200)"`
+	C4        string `xorm:"VARCHAR(200)"`
+	C5        string `xorm:"VARCHAR(200)"`
+	C6        string `xorm:"VARCHAR(200)"`
+	C7        string `xorm:"VARCHAR(200)"`
+	C8        string `xorm:"VARCHAR(200)"`
+	C9        string `xorm:"VARCHAR(200)"`
+	C10       string `xorm:"VARCHAR(200)"`
+	C11       string `xorm:"VARCHAR(200)"`
+	C12       string `xorm:"VARCHAR(200)"`
+	C13       string `xorm:"VARCHAR(200)"`
+	C14       string `xorm:"VARCHAR(200)"`
+	C15       string `xorm:"VARCHAR(200)"`
+	C16       string `xorm:"VARCHAR(200)"`
+	C17       string `xorm:"VARCHAR(200)"`
+	C18       string `xorm:"VARCHAR(200)"`
+	C19       string `xorm:"VARCHAR(200)"`
+	C20       string `xorm:"VARCHAR(200)"`
+	C21       string `xorm:"VARCHAR(200)"`
+	C22       string `xorm:"VARCHAR(200)"`
+	C23       string `xorm:"VARCHAR(200)"`
+	C24       string `xorm:"VARCHAR(200)"`
+	C25       string `xorm:"VARCHAR(200)"`
+	C26       string `xorm:"VARCHAR(200)"`
+	C27       string `xorm:"VARCHAR(200)"`
+	C28       string `xorm:"VARCHAR(200)"`
+	C29       string `xorm:"VARCHAR(200)"`
+	C30       string `xorm:"VARCHAR(200)"`
+	C31       string `xorm:"VARCHAR(200)"`
+	C32       string `xorm:"VARCHAR(200)"`
+	C33       string `xorm:"VARCHAR(200)"`
+	C34       string `xorm:"VARCHAR(200)"`
+	C35       string `xorm:"VARCHAR(200)"`
+	C36       string `xorm:"VARCHAR(200)"`
+	C37       string `xorm:"VARCHAR(200)"`
+	C38       string `xorm:"VARCHAR(200)"`
+	C39       string `xorm:"VARCHAR(200)"`
+	C40       string `xorm:"VARCHAR(200)"`
+}
+
+type ZspTestLog struct {
+	Id      int       `xorm:"not null pk autoincr INT(10)"`
+	LogTime time.Time `xorm:"default current_timestamp() TIMESTAMP"`
+	C1      string    `xorm:"VARCHAR(64)"`
+	C2      string    `xorm:"VARCHAR(64)"`
+	C3      string    `xorm:"VARCHAR(64)"`
+	C4      string    `xorm:"VARCHAR(64)"`
+	C5      string    `xorm:"VARCHAR(64)"`
+	C6      string    `xorm:"VARCHAR(64)"`
+	C7      string    `xorm:"VARCHAR(64)"`
+	C8      string    `xorm:"VARCHAR(64)"`
+	C9      string    `xorm:"VARCHAR(64)"`
+	C10     string    `xorm:"VARCHAR(64)"`
+	T1      string    `xorm:"MEDIUMTEXT"`
+	T2      string    `xorm:"MEDIUMTEXT"`
+	D1      int       `xorm:"INT(11)"`
+}
+
+type ProPostBd struct {
+	Id             int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	PostId         int    `xorm:"default 0 INT(11)"`
+	MemberId       int    `xorm:"not null INT(11)"`
+	UserId         int    `xorm:"default 0 INT(11)"`
+	BdSlug         string `xorm:"VARCHAR(200)"`
+	BdContents     string `xorm:"LONGTEXT"`
+	BdExcerpt      string `xorm:"TEXT"`
+	BdPostPassword string `xorm:"VARCHAR(255)"`
+	BdGuid         string `xorm:"VARCHAR(255)"`
+	BdPingStatus   string `xorm:"VARCHAR(20)"`
+	BdToPing       string `xorm:"TEXT"`
+	BdPinged       string `xorm:"TEXT"`
+	BdPostMimeType string `xorm:"VARCHAR(100)"`
+	ParentId       int    `xorm:"INT(11)"`
+	Ip             string `xorm:"VARCHAR(20)"`
+}
+
+type ProPostLang struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	PostId       int    `xorm:"comment('post_id') INT(11)"`
+	SeqNo        int    `xorm:"not null default 0 comment('일련번호') TINYINT(4)"`
+	LangType     string `xorm:"comment('언어코드') VARCHAR(3)"`
+	LangTitle    string `xorm:"comment('글제목') TEXT"`
+	LangContents string `xorm:"comment('상세내용-html') MEDIUMTEXT"`
+	LangExcerpt  string `xorm:"comment('내용축약') TEXT"`
+	LangPc1      string `xorm:"comment('추가필드-varchar') VARCHAR(64)"`
+	LangPc2      string `xorm:"VARCHAR(64)"`
+	LangPc3      string `xorm:"VARCHAR(64)"`
+	LangPc4      string `xorm:"VARCHAR(64)"`
+	LangPc5      string `xorm:"VARCHAR(64)"`
+	LangPc6      string `xorm:"VARCHAR(64)"`
+	LangPc7      string `xorm:"VARCHAR(64)"`
+	LangPc8      string `xorm:"VARCHAR(64)"`
+	LangPc9      string `xorm:"VARCHAR(64)"`
+	LangPc10     string `xorm:"VARCHAR(64)"`
+	LangPt1      string `xorm:"comment('추가필드-text') TEXT"`
+	LangPt2      string `xorm:"TEXT"`
+	LangMeta     string `xorm:"not null comment('게시판Seo-Meta') TEXT"`
+	Ip           string `xorm:"VARCHAR(20)"`
+}
+
+type ProPostType struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	SeqNo     int    `xorm:"not null default 0 comment('리스트 순서') TINYINT(4)"`
+	Sort      string `xorm:"not null default '' comment('종류코드') VARCHAR(3)"`
+	PostCode  string `xorm:"not null default '' comment('쿼리필터용 코드') VARCHAR(21)"`
+	BrandCode string `xorm:"not null default '' comment('종속코드') VARCHAR(16)"`
+	SortDesc  string `xorm:"not null default '' comment('게시판 설정') VARCHAR(36)"`
+	Duid      string `xorm:"not null default '' CHAR(36)"`
+	TypeSlug  string `xorm:"not null default '' comment('게시판구분슬러그') unique VARCHAR(128)"`
+	TypeMeta  string `xorm:"not null default ' ' comment('게시판구분Seo-Meta') TEXT"`
+	Status    string `xorm:"not null default '0' CHAR(1)"`
+	IsUnused  string `xorm:"not null default '0' CHAR(1)"`
+	Ip        string `xorm:"not null default '' VARCHAR(21)"`
+}
+
+type ProSeoMeta struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	JoinDuid  string `xorm:"not null default '' unique CHAR(36)"`
+	SeoSlug   string `xorm:"VARCHAR(256)"`
+	SeoJson   string `xorm:"not null default '' TEXT"`
+	Ip        string `xorm:"not null default '' VARCHAR(21)"`
+}
+
+type ProSorderShop struct {
+	Id            int    `xorm:"not null pk INT(11)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	Paymethod     string `xorm:"not null default '0' comment('결재방식') CHAR(2)"`
+	ShipMethod    string `xorm:"comment('배송방식') VARCHAR(32)"`
+	ShipfeeAmt    string `xorm:"default 0.0000 comment('배송비') DECIMAL(20,4)"`
+	ContactName   string `xorm:"comment('연락처명') VARCHAR(64)"`
+	ContactMobile string `xorm:"comment('모바일번호') VARCHAR(21)"`
+	ZipCode       string `xorm:"comment('우편번호') VARCHAR(21)"`
+	Addr1         string `xorm:"comment('주소1') VARCHAR(64)"`
+	Addr2         string `xorm:"comment('주소2') VARCHAR(64)"`
+}
+
+type ProTicketBd struct {
+	Id            int       `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64     `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64     `xorm:"default 0 BIGINT(20)"`
+	TicketId      int64     `xorm:"not null BIGINT(20)"`
+	AuthorId      int64     `xorm:"not null BIGINT(20)"`
+	Content       string    `xorm:"not null LONGTEXT"`
+	Meta          string    `xorm:"LONGTEXT"`
+	AttachmentIds string    `xorm:"not null MEDIUMTEXT"`
+	IsPrivate     string    `xorm:"not null default '0' CHAR(1)"`
+	IsStaffReply  string    `xorm:"not null default '0' CHAR(1)"`
+	IsViaEmail    string    `xorm:"not null default '0' CHAR(1)"`
+	DateCreated   time.Time `xorm:"not null DATETIME"`
+}
+
+type ProWidgetTaxo struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"not null default 0 BIGINT(11)"`
+	UpdatedOn    int64  `xorm:"not null default 0 BIGINT(11)"`
+	WidgetTaxoNo string `xorm:"comment('분류번호') unique VARCHAR(21)"`
+	TaxoCode     string `xorm:"not null default '' comment('데이터필터용 텍소코드') VARCHAR(30)"`
+	LangType     string `xorm:"not null default '' comment('언어구분') VARCHAR(3)"`
+	DeviceType   string `xorm:"not null default '' comment('디바이스구분') VARCHAR(10)"`
+	UserId       int    `xorm:"not null default 1 comment('사용자') INT(10)"`
+	BranchId     int    `xorm:"not null default 1 comment('지사구분') INT(10)"`
+	TaxoDate     string `xorm:"not null default '' comment('분류일자') CHAR(8)"`
+	SubPosition  string `xorm:"not null default '' comment('main, sub page 정렬코드') VARCHAR(8)"`
+	TaxoName     string `xorm:"not null default '' comment('분류명') VARCHAR(50)"`
+	TaxoHtml     string `xorm:"not null default '' comment('body html') TEXT"`
+	Remarks      string `xorm:"not null default '' comment('분류설명 memo') TEXT"`
+}
+
+type ProWidgetTaxoBd struct {
+	Id           int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	WidgetTaxoId int    `xorm:"not null comment('배너분류ID') INT(10)"`
+	SeqNo        int    `xorm:"not null default 0 comment('순서') TINYINT(4)"`
+	MediaId      int    `xorm:"not null default 1 INT(11)"`
+	LinkUrl      string `xorm:"default 'NULL' comment('링크URL') TEXT"`
+	WidgetDesc   string `xorm:"comment('widget 내용') TEXT"`
+	LayerJson    string `xorm:"comment('layer bd 추가') TEXT"`
+	IsSkipped    string `xorm:"not null comment('표시않음') CHAR(1)"`
+}
+
+type ProWish struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	WishDate      string `xorm:"not null default '구독신청일' index CHAR(8)"`
+	WishNo        string `xorm:"comment('구독번호') unique VARCHAR(21)"`
+	MemberBuyerId int    `xorm:"not null default 0 comment('고객id') INT(10)"`
+	ItemId        int    `xorm:"not null default 0 comment('품목코드') index INT(10)"`
+	WishQty       string `xorm:"not null default 0.0000 comment('위시수량') DECIMAL(20,4)"`
+	WishPrc       string `xorm:"not null default 0.0000 comment('위시가격') DECIMAL(20,4)"`
+	WishAmt       string `xorm:"not null default 0.0000 comment('위시금액') DECIMAL(20,4)"`
+	Column1       string `xorm:"comment('추가항목2') VARCHAR(49)"`
+	Column2       string `xorm:"comment('추가항목2') VARCHAR(49)"`
+	WishDesc      string `xorm:"comment('상세내용') MEDIUMTEXT"`
+	IsSubscribed  string `xorm:"not null default '0' comment('구독여부') CHAR(4)"`
+	Ip            string `xorm:"VARCHAR(21)"`
+}
+
+type UptDbupdate struct {
+	Id            int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	DbupdateNo    string `xorm:"unique VARCHAR(21)"`
+	UserId        int    `xorm:"not null default 0 INT(10)"`
+	Sort          string `xorm:"VARCHAR(21)"`
+	RelatedTables string `xorm:"VARCHAR(128)"`
+	SqlCommand    string `xorm:"MEDIUMTEXT"`
+	IsConfirmed   string `xorm:"not null default '0' CHAR(1)"`
+	Ip            string `xorm:"VARCHAR(20)"`
+}
+
+type UptEncrypt struct {
+	Id          int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn   int64  `xorm:"default 0 BIGINT(20)"`
+	EncryptCode string `xorm:"unique VARCHAR(50)"`
+	UserId      int    `xorm:"not null default 0 INT(10)"`
+	Sort        string `xorm:"VARCHAR(21)"`
+	EncryptKey  string `xorm:"VARCHAR(256)"`
+	SaltKey     string `xorm:"VARCHAR(256)"`
+	Ip          string `xorm:"VARCHAR(20)"`
+}
+
+type Users struct {
+	Id                int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn         int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn         int64  `xorm:"default 0 BIGINT(20)"`
+	DeletedOn         int64  `xorm:"BIGINT(20)"`
+	ActivatedOn       int64  `xorm:"BIGINT(20)"`
+	LastLoginOn       int64  `xorm:"BIGINT(20)"`
+	LastSeenOn        int64  `xorm:"BIGINT(10)"`
+	UsersDate         string `xorm:"VARCHAR(8)"`
+	Email             string `xorm:"not null unique VARCHAR(191)"`
+	Password          string `xorm:"not null VARCHAR(191)"`
+	SsoBrand          string `xorm:"VARCHAR(64)"`
+	SsoSub            string `xorm:"VARCHAR(64)"`
+	LoginId           string `xorm:"VARCHAR(64)"`
+	ResetPasswordCode string `xorm:"VARCHAR(191)"`
+	ActivateCode      string `xorm:"not null VARCHAR(64)"`
+	ResetCode         string `xorm:"default 'MD5(RAND()) ' VARCHAR(32)"`
+	NickName          string `xorm:"VARCHAR(191)"`
+	FirstName         string `xorm:"VARCHAR(191)"`
+	SurName           string `xorm:"VARCHAR(191)"`
+	IsGuest           string `xorm:"not null default '0' CHAR(1)"`
+	IsActivated       string `xorm:"not null default '0' CHAR(1)"`
+	IsSuperuser       string `xorm:"not null default '0' CHAR(1)"`
+	Sort              string `xorm:"default '0' CHAR(1)"`
+	Status            string `xorm:"CHAR(1)"`
+	CreatedIp         string `xorm:"VARCHAR(21)"`
+	LastloginIp       string `xorm:"VARCHAR(21)"`
+	IsWithdrawn       string `xorm:"default '0' CHAR(1)"`
+}
+
+type ZdbSupplier struct {
+	TId       int    `xorm:"not null pk autoincr unique INT(10)"`
+	Id        int    `xorm:"INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"VARCHAR(21)"`
+	OrderBy   string `xorm:"VARCHAR(32)"`
+	C1        string `xorm:"VARCHAR(200)"`
+	C2        string `xorm:"VARCHAR(200)"`
+	C3        string `xorm:"VARCHAR(200)"`
+	C4        string `xorm:"VARCHAR(200)"`
+	C5        string `xorm:"VARCHAR(200)"`
+	C6        string `xorm:"VARCHAR(200)"`
+	C7        string `xorm:"VARCHAR(200)"`
+	C8        string `xorm:"VARCHAR(200)"`
+	C9        string `xorm:"VARCHAR(200)"`
+	C10       string `xorm:"VARCHAR(200)"`
+	C11       string `xorm:"VARCHAR(200)"`
+	C12       string `xorm:"VARCHAR(200)"`
+	C13       string `xorm:"VARCHAR(200)"`
+	C14       string `xorm:"VARCHAR(200)"`
+	C15       string `xorm:"VARCHAR(200)"`
+	C16       string `xorm:"VARCHAR(200)"`
+	C17       string `xorm:"VARCHAR(200)"`
+	C18       string `xorm:"VARCHAR(200)"`
+	C19       string `xorm:"VARCHAR(200)"`
+	C20       string `xorm:"VARCHAR(200)"`
+	C21       string `xorm:"VARCHAR(200)"`
+	C22       string `xorm:"VARCHAR(200)"`
+	C23       string `xorm:"VARCHAR(200)"`
+	C24       string `xorm:"VARCHAR(200)"`
+	C25       string `xorm:"VARCHAR(200)"`
+	C26       string `xorm:"VARCHAR(200)"`
+	C27       string `xorm:"VARCHAR(200)"`
+	C28       string `xorm:"VARCHAR(200)"`
+	C29       string `xorm:"VARCHAR(200)"`
+	C30       string `xorm:"VARCHAR(200)"`
+	C31       string `xorm:"VARCHAR(200)"`
+	C32       string `xorm:"VARCHAR(200)"`
+	C33       string `xorm:"VARCHAR(200)"`
+	C34       string `xorm:"VARCHAR(200)"`
+	C35       string `xorm:"VARCHAR(200)"`
+	C36       string `xorm:"VARCHAR(200)"`
+	C37       string `xorm:"VARCHAR(200)"`
+	C38       string `xorm:"VARCHAR(200)"`
+	C39       string `xorm:"VARCHAR(200)"`
+	C40       string `xorm:"VARCHAR(200)"`
+	D1        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D2        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D3        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D4        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D5        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D6        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D7        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D8        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D9        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D10       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D11       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D12       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D13       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D14       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D15       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D16       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D17       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D18       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D19       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D20       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	IsSum     string `xorm:"not null default '0' CHAR(1)"`
+	T1        string `xorm:"TEXT"`
+	T2        string `xorm:"TEXT"`
+	T3        string `xorm:"TEXT"`
+	T4        string `xorm:"TEXT"`
+}
+
+type ZdbBuyer struct {
+	TId       int    `xorm:"not null pk autoincr unique INT(10)"`
+	Id        int    `xorm:"INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"VARCHAR(21)"`
+	OrderBy   string `xorm:"VARCHAR(32)"`
+	C1        string `xorm:"VARCHAR(200)"`
+	C2        string `xorm:"VARCHAR(200)"`
+	C3        string `xorm:"VARCHAR(200)"`
+	C4        string `xorm:"VARCHAR(200)"`
+	C5        string `xorm:"VARCHAR(200)"`
+	C6        string `xorm:"VARCHAR(200)"`
+	C7        string `xorm:"VARCHAR(200)"`
+	C8        string `xorm:"VARCHAR(200)"`
+	C9        string `xorm:"VARCHAR(200)"`
+	C10       string `xorm:"VARCHAR(200)"`
+	C11       string `xorm:"VARCHAR(200)"`
+	C12       string `xorm:"VARCHAR(200)"`
+	C13       string `xorm:"VARCHAR(200)"`
+	C14       string `xorm:"VARCHAR(200)"`
+	C15       string `xorm:"VARCHAR(200)"`
+	C16       string `xorm:"VARCHAR(200)"`
+	C17       string `xorm:"VARCHAR(200)"`
+	C18       string `xorm:"VARCHAR(200)"`
+	C19       string `xorm:"VARCHAR(200)"`
+	C20       string `xorm:"VARCHAR(200)"`
+	C21       string `xorm:"VARCHAR(200)"`
+	C22       string `xorm:"VARCHAR(200)"`
+	C23       string `xorm:"VARCHAR(200)"`
+	C24       string `xorm:"VARCHAR(200)"`
+	C25       string `xorm:"VARCHAR(200)"`
+	C26       string `xorm:"VARCHAR(200)"`
+	C27       string `xorm:"VARCHAR(200)"`
+	C28       string `xorm:"VARCHAR(200)"`
+	C29       string `xorm:"VARCHAR(200)"`
+	C30       string `xorm:"VARCHAR(200)"`
+	C31       string `xorm:"VARCHAR(200)"`
+	C32       string `xorm:"VARCHAR(200)"`
+	C33       string `xorm:"VARCHAR(200)"`
+	C34       string `xorm:"VARCHAR(200)"`
+	C35       string `xorm:"VARCHAR(200)"`
+	C36       string `xorm:"VARCHAR(200)"`
+	C37       string `xorm:"VARCHAR(200)"`
+	C38       string `xorm:"VARCHAR(200)"`
+	C39       string `xorm:"VARCHAR(200)"`
+	C40       string `xorm:"VARCHAR(200)"`
+	D1        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D2        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D3        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D4        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D5        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D6        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D7        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D8        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D9        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D10       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D11       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D12       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D13       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D14       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D15       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D16       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D17       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D18       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D19       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D20       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	IsSum     string `xorm:"not null default '0' CHAR(1)"`
+	T1        string `xorm:"TEXT"`
+	T2        string `xorm:"TEXT"`
+	T3        string `xorm:"TEXT"`
+	T4        string `xorm:"TEXT"`
+}
+
+type ZdbEyetest struct {
+	TId       int    `xorm:"not null pk autoincr unique INT(10)"`
+	Id        int    `xorm:"INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"VARCHAR(21)"`
+	OrderBy   string `xorm:"VARCHAR(32)"`
+	C1        string `xorm:"VARCHAR(64)"`
+	C2        string `xorm:"VARCHAR(64)"`
+	C3        string `xorm:"VARCHAR(64)"`
+	C4        string `xorm:"VARCHAR(64)"`
+	C5        string `xorm:"VARCHAR(64)"`
+	C6        string `xorm:"VARCHAR(64)"`
+	C7        string `xorm:"VARCHAR(64)"`
+	C8        string `xorm:"VARCHAR(64)"`
+	C9        string `xorm:"VARCHAR(64)"`
+	C10       string `xorm:"VARCHAR(64)"`
+	C11       string `xorm:"VARCHAR(64)"`
+	C12       string `xorm:"VARCHAR(64)"`
+	C13       string `xorm:"VARCHAR(64)"`
+	C14       string `xorm:"VARCHAR(64)"`
+	C15       string `xorm:"VARCHAR(64)"`
+	C16       string `xorm:"VARCHAR(64)"`
+	C17       string `xorm:"VARCHAR(64)"`
+	C18       string `xorm:"VARCHAR(64)"`
+	C19       string `xorm:"VARCHAR(64)"`
+	C20       string `xorm:"VARCHAR(64)"`
+	C21       string `xorm:"VARCHAR(64)"`
+	C22       string `xorm:"VARCHAR(64)"`
+	C23       string `xorm:"VARCHAR(64)"`
+	C24       string `xorm:"VARCHAR(64)"`
+	C25       string `xorm:"VARCHAR(64)"`
+	C26       string `xorm:"VARCHAR(64)"`
+	C27       string `xorm:"VARCHAR(64)"`
+	C28       string `xorm:"VARCHAR(64)"`
+	C29       string `xorm:"VARCHAR(64)"`
+	C30       string `xorm:"VARCHAR(64)"`
+	C31       string `xorm:"VARCHAR(64)"`
+	C32       string `xorm:"VARCHAR(64)"`
+	C33       string `xorm:"VARCHAR(64)"`
+	C34       string `xorm:"VARCHAR(64)"`
+	C35       string `xorm:"VARCHAR(64)"`
+	C36       string `xorm:"VARCHAR(64)"`
+	C37       string `xorm:"VARCHAR(64)"`
+	C38       string `xorm:"VARCHAR(64)"`
+	C39       string `xorm:"VARCHAR(64)"`
+	C40       string `xorm:"VARCHAR(64)"`
+}
+
+type ZdbItem struct {
+	TId       int    `xorm:"not null pk autoincr unique INT(10)"`
+	Id        int    `xorm:"INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"VARCHAR(21)"`
+	OrderBy   string `xorm:"VARCHAR(32)"`
+	C1        string `xorm:"VARCHAR(200)"`
+	C2        string `xorm:"VARCHAR(200)"`
+	C3        string `xorm:"VARCHAR(200)"`
+	C4        string `xorm:"VARCHAR(200)"`
+	C5        string `xorm:"VARCHAR(200)"`
+	C6        string `xorm:"VARCHAR(200)"`
+	C7        string `xorm:"VARCHAR(200)"`
+	C8        string `xorm:"VARCHAR(200)"`
+	C9        string `xorm:"VARCHAR(200)"`
+	C10       string `xorm:"VARCHAR(200)"`
+	C11       string `xorm:"VARCHAR(200)"`
+	C12       string `xorm:"VARCHAR(200)"`
+	C13       string `xorm:"VARCHAR(200)"`
+	C14       string `xorm:"VARCHAR(200)"`
+	C15       string `xorm:"VARCHAR(200)"`
+	C16       string `xorm:"VARCHAR(200)"`
+	C17       string `xorm:"VARCHAR(200)"`
+	C18       string `xorm:"VARCHAR(200)"`
+	C19       string `xorm:"VARCHAR(200)"`
+	C20       string `xorm:"VARCHAR(200)"`
+	C21       string `xorm:"VARCHAR(200)"`
+	C22       string `xorm:"VARCHAR(200)"`
+	C23       string `xorm:"VARCHAR(200)"`
+	C24       string `xorm:"VARCHAR(200)"`
+	C25       string `xorm:"VARCHAR(200)"`
+	C26       string `xorm:"VARCHAR(200)"`
+	C27       string `xorm:"VARCHAR(200)"`
+	C28       string `xorm:"VARCHAR(200)"`
+	C29       string `xorm:"VARCHAR(200)"`
+	C30       string `xorm:"VARCHAR(200)"`
+	C31       string `xorm:"VARCHAR(200)"`
+	C32       string `xorm:"VARCHAR(200)"`
+	C33       string `xorm:"VARCHAR(200)"`
+	C34       string `xorm:"VARCHAR(200)"`
+	C35       string `xorm:"VARCHAR(200)"`
+	C36       string `xorm:"VARCHAR(200)"`
+	C37       string `xorm:"VARCHAR(200)"`
+	C38       string `xorm:"VARCHAR(200)"`
+	C39       string `xorm:"VARCHAR(200)"`
+	C40       string `xorm:"VARCHAR(200)"`
+	D1        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D2        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D3        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D4        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D5        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D6        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D7        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D8        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D9        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D10       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D11       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D12       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D13       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D14       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D15       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D16       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D17       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D18       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D19       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D20       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	IsSum     string `xorm:"not null default '0' CHAR(1)"`
+	T1        string `xorm:"TEXT"`
+	T2        string `xorm:"TEXT"`
+	T3        string `xorm:"TEXT"`
+	T4        string `xorm:"TEXT"`
+}
+
+type ZdbListType1 struct {
+	TId       int    `xorm:"not null pk autoincr unique INT(10)"`
+	Id        int    `xorm:"INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"VARCHAR(21)"`
+	OrderBy   string `xorm:"VARCHAR(32)"`
+	C1        string `xorm:"VARCHAR(200)"`
+	C2        string `xorm:"VARCHAR(200)"`
+	C3        string `xorm:"VARCHAR(200)"`
+	C4        string `xorm:"VARCHAR(200)"`
+	C5        string `xorm:"VARCHAR(200)"`
+	C6        string `xorm:"VARCHAR(200)"`
+	C7        string `xorm:"VARCHAR(200)"`
+	C8        string `xorm:"VARCHAR(200)"`
+	C9        string `xorm:"VARCHAR(200)"`
+	C10       string `xorm:"VARCHAR(200)"`
+	C11       string `xorm:"VARCHAR(200)"`
+	C12       string `xorm:"VARCHAR(200)"`
+	C13       string `xorm:"VARCHAR(200)"`
+	C14       string `xorm:"VARCHAR(200)"`
+	C15       string `xorm:"VARCHAR(200)"`
+	C16       string `xorm:"VARCHAR(200)"`
+	C17       string `xorm:"VARCHAR(200)"`
+	C18       string `xorm:"VARCHAR(200)"`
+	C19       string `xorm:"VARCHAR(200)"`
+	C20       string `xorm:"VARCHAR(200)"`
+	C21       string `xorm:"VARCHAR(200)"`
+	C22       string `xorm:"VARCHAR(200)"`
+	C23       string `xorm:"VARCHAR(200)"`
+	C24       string `xorm:"VARCHAR(200)"`
+	C25       string `xorm:"VARCHAR(200)"`
+	C26       string `xorm:"VARCHAR(200)"`
+	C27       string `xorm:"VARCHAR(200)"`
+	C28       string `xorm:"VARCHAR(200)"`
+	C29       string `xorm:"VARCHAR(200)"`
+	C30       string `xorm:"VARCHAR(200)"`
+	C31       string `xorm:"VARCHAR(200)"`
+	C32       string `xorm:"VARCHAR(200)"`
+	C33       string `xorm:"VARCHAR(200)"`
+	C34       string `xorm:"VARCHAR(200)"`
+	C35       string `xorm:"VARCHAR(200)"`
+	C36       string `xorm:"VARCHAR(200)"`
+	C37       string `xorm:"VARCHAR(200)"`
+	C38       string `xorm:"VARCHAR(200)"`
+	C39       string `xorm:"VARCHAR(200)"`
+	C40       string `xorm:"VARCHAR(200)"`
+	D1        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D2        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D3        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D4        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D5        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D6        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D7        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D8        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D9        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D10       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D11       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D12       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D13       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D14       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D15       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D16       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D17       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D18       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D19       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D20       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	IsSum     string `xorm:"not null default '0' CHAR(1)"`
+	T1        string `xorm:"TEXT"`
+	T2        string `xorm:"TEXT"`
+	T3        string `xorm:"TEXT"`
+	T4        string `xorm:"TEXT"`
+}
+
+type ZdbNonitem struct {
+	TId       int    `xorm:"not null pk autoincr unique INT(10)"`
+	Id        int    `xorm:"INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"VARCHAR(21)"`
+	OrderBy   string `xorm:"VARCHAR(32)"`
+	C1        string `xorm:"VARCHAR(200)"`
+	C2        string `xorm:"VARCHAR(200)"`
+	C3        string `xorm:"VARCHAR(200)"`
+	C4        string `xorm:"VARCHAR(200)"`
+	C5        string `xorm:"VARCHAR(200)"`
+	C6        string `xorm:"VARCHAR(200)"`
+	C7        string `xorm:"VARCHAR(200)"`
+	C8        string `xorm:"VARCHAR(200)"`
+	C9        string `xorm:"VARCHAR(200)"`
+	C10       string `xorm:"VARCHAR(200)"`
+	C11       string `xorm:"VARCHAR(200)"`
+	C12       string `xorm:"VARCHAR(200)"`
+	C13       string `xorm:"VARCHAR(200)"`
+	C14       string `xorm:"VARCHAR(200)"`
+	C15       string `xorm:"VARCHAR(200)"`
+	C16       string `xorm:"VARCHAR(200)"`
+	C17       string `xorm:"VARCHAR(200)"`
+	C18       string `xorm:"VARCHAR(200)"`
+	C19       string `xorm:"VARCHAR(200)"`
+	C20       string `xorm:"VARCHAR(200)"`
+	C21       string `xorm:"VARCHAR(200)"`
+	C22       string `xorm:"VARCHAR(200)"`
+	C23       string `xorm:"VARCHAR(200)"`
+	C24       string `xorm:"VARCHAR(200)"`
+	C25       string `xorm:"VARCHAR(200)"`
+	C26       string `xorm:"VARCHAR(200)"`
+	C27       string `xorm:"VARCHAR(200)"`
+	C28       string `xorm:"VARCHAR(200)"`
+	C29       string `xorm:"VARCHAR(200)"`
+	C30       string `xorm:"VARCHAR(200)"`
+	C31       string `xorm:"VARCHAR(200)"`
+	C32       string `xorm:"VARCHAR(200)"`
+	C33       string `xorm:"VARCHAR(200)"`
+	C34       string `xorm:"VARCHAR(200)"`
+	C35       string `xorm:"VARCHAR(200)"`
+	C36       string `xorm:"VARCHAR(200)"`
+	C37       string `xorm:"VARCHAR(200)"`
+	C38       string `xorm:"VARCHAR(200)"`
+	C39       string `xorm:"VARCHAR(200)"`
+	C40       string `xorm:"VARCHAR(200)"`
+	D1        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D2        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D3        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D4        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D5        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D6        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D7        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D8        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D9        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D10       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D11       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D12       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D13       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D14       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D15       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D16       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D17       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D18       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D19       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D20       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	IsSum     string `xorm:"not null default '0' CHAR(1)"`
+	T1        string `xorm:"TEXT"`
+	T2        string `xorm:"TEXT"`
+	T3        string `xorm:"TEXT"`
+	T4        string `xorm:"TEXT"`
+}
+
+type ZdbSales struct {
+	TId       int    `xorm:"not null pk autoincr unique INT(10)"`
+	Id        int    `xorm:"INT(10)"`
+	CreatedOn int64  `xorm:"default 0 BIGINT(20)"`
+	ListToken string `xorm:"VARCHAR(21)"`
+	OrderBy   string `xorm:"VARCHAR(32)"`
+	C1        string `xorm:"VARCHAR(100)"`
+	C2        string `xorm:"VARCHAR(100)"`
+	C3        string `xorm:"VARCHAR(100)"`
+	C4        string `xorm:"VARCHAR(100)"`
+	C5        string `xorm:"VARCHAR(100)"`
+	C6        string `xorm:"VARCHAR(100)"`
+	C7        string `xorm:"VARCHAR(100)"`
+	C8        string `xorm:"VARCHAR(100)"`
+	C9        string `xorm:"VARCHAR(100)"`
+	C10       string `xorm:"VARCHAR(100)"`
+	C11       string `xorm:"VARCHAR(100)"`
+	C12       string `xorm:"VARCHAR(100)"`
+	C13       string `xorm:"VARCHAR(100)"`
+	C14       string `xorm:"VARCHAR(100)"`
+	C15       string `xorm:"VARCHAR(100)"`
+	C16       string `xorm:"VARCHAR(100)"`
+	C17       string `xorm:"VARCHAR(100)"`
+	C18       string `xorm:"VARCHAR(100)"`
+	C19       string `xorm:"VARCHAR(100)"`
+	C20       string `xorm:"VARCHAR(100)"`
+	C21       string `xorm:"VARCHAR(100)"`
+	C22       string `xorm:"VARCHAR(100)"`
+	C23       string `xorm:"VARCHAR(100)"`
+	C24       string `xorm:"VARCHAR(100)"`
+	C25       string `xorm:"VARCHAR(100)"`
+	C26       string `xorm:"VARCHAR(100)"`
+	C27       string `xorm:"VARCHAR(100)"`
+	C28       string `xorm:"VARCHAR(100)"`
+	C29       string `xorm:"VARCHAR(100)"`
+	C30       string `xorm:"VARCHAR(100)"`
+	C31       string `xorm:"VARCHAR(100)"`
+	C32       string `xorm:"VARCHAR(100)"`
+	C33       string `xorm:"VARCHAR(100)"`
+	C34       string `xorm:"VARCHAR(100)"`
+	C35       string `xorm:"VARCHAR(100)"`
+	C36       string `xorm:"VARCHAR(100)"`
+	C37       string `xorm:"VARCHAR(100)"`
+	C38       string `xorm:"VARCHAR(100)"`
+	C39       string `xorm:"VARCHAR(100)"`
+	C40       string `xorm:"VARCHAR(100)"`
+	D1        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D2        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D3        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D4        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D5        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D6        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D7        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D8        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D9        string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D10       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D11       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D12       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D13       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D14       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D15       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D16       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D17       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D18       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D19       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	D20       string `xorm:"default 0.0000 DECIMAL(20,4)"`
+	IsSum     string `xorm:"not null default '0' CHAR(1)"`
+	T1        string `xorm:"TEXT"`
+	T2        string `xorm:"TEXT"`
+	T3        string `xorm:"TEXT"`
+	T4        string `xorm:"TEXT"`
+}
+
+type ZzzBrUiDic struct {
+	Id         int       `xorm:"not null pk autoincr INT(10)"`
+	CreatedAt  time.Time `xorm:"TIMESTAMP"`
+	UpdatedAt  time.Time `xorm:"TIMESTAMP"`
+	PluginName string    `xorm:"VARCHAR(100)"`
+	En         string    `xorm:"VARCHAR(100)"`
+	Ko         string    `xorm:"VARCHAR(100)"`
+	Vn         string    `xorm:"VARCHAR(100)"`
+	Ch         string    `xorm:"VARCHAR(100)"`
+	Jp         string    `xorm:"VARCHAR(100)"`
+}
+
+type EthLastSync struct {
+	Id        int    `xorm:"not null pk autoincr INT(10)"`
+	CreatedOn int64  `xorm:"not null BIGINT(11)"`
+	UpdatedOn int64  `xorm:"not null BIGINT(11)"`
+	SyncType  string `xorm:"not null VARCHAR(32)"`
+	LastNo    string `xorm:"not null default '1' comment('마지막 싱크블록 번호를 넣음') VARCHAR(32)"`
+	SyncRange string `xorm:"not null VARCHAR(64)"`
+	SyncCnt   int    `xorm:"not null INT(11)"`
+}
+
+type EthTokenAdd struct {
+	Id           int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	UpdatedOn    int64  `xorm:"default 0 BIGINT(20)"`
+	CntrAddr     string `xorm:"VARCHAR(64)"`
+	IconImage    string `xorm:"VARCHAR(500)"`
+	UnitPoint    int    `xorm:"not null default 0 TINYINT(4)"`
+	DecimalPoint int    `xorm:"not null default 0 TINYINT(4)"`
+	FeePoint     int    `xorm:"not null default 0 TINYINT(4)"`
+	TokenDesc    string `xorm:"TINYTEXT"`
+	SiteUrl      string `xorm:"VARCHAR(256)"`
+	SnsUrl       string `xorm:"VARCHAR(256)"`
+	TokenTracker string `xorm:"VARCHAR(128)"`
+	Ip           string `xorm:"VARCHAR(20)"`
+}
+
+type EthToken struct {
+	Id             int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn      int64  `xorm:"default 0 BIGINT(20)"`
+	UpdateOn       int64  `xorm:"not null default 0 BIGINT(20)"`
+	CntrAddr       string `xorm:"unique VARCHAR(64)"`
+	TokenName      string `xorm:"VARCHAR(20)"`
+	WeiDecimals    int    `xorm:"comment('wei단위 적용 소숫점') SMALLINT(10)"`
+	CurrBalQty     string `xorm:"comment('현재 잔량') DECIMAL(32)"`
+	Symbol         string `xorm:"default '' comment('토큰 심볼') VARCHAR(21)"`
+	TotalCirculQty string `xorm:"not null default 0 comment('총공급량') DECIMAL(30)"`
+}
+
+type EthTokenHolder struct {
+	Id         int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	CntrAddr   string `xorm:"unique(idx_token_holder) VARCHAR(66)"`
+	HolderAddr string `xorm:"unique(idx_token_holder) VARCHAR(66)"`
+	TotalSum   string `xorm:"DECIMAL(30)"`
+	LastSum    string `xorm:"default 0 DECIMAL(30)"`
+}
+
+type EthTranxn struct {
+	Id         int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn  int64  `xorm:"default 0 BIGINT(20)"`
+	BlockNo    int    `xorm:"INT(11)"`
+	BlockHash  string `xorm:"VARCHAR(66)"`
+	TxnHash    string `xorm:"unique VARCHAR(66)"`
+	CntrAddr   string `xorm:"index VARCHAR(66)"`
+	FromAddr   string `xorm:"VARCHAR(66)"`
+	ToAddr     string `xorm:"VARCHAR(66)"`
+	TxnType    string `xorm:"VARCHAR(50)"`
+	TxnSymbol  string `xorm:"not null default '' VARCHAR(120)"`
+	Value      string `xorm:"default 0 DECIMAL(32)"`
+	InputValue string `xorm:"not null default 0 DECIMAL(32)"`
+	TxnFee     string `xorm:"default 0.00000000 DECIMAL(16,8)"`
+	Input      []byte `xorm:"BLOB"`
+	GasUsed    string `xorm:"not null default 0 DECIMAL(11)"`
+	Status     int    `xorm:"not null default -1 INT(11)"`
+}
+
+type EthTransInter struct {
+	Id            int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	BlockNo       int    `xorm:"unique(idx_block_no) INT(11)"`
+	BlockHash     string `xorm:"unique(idx_block_no) VARCHAR(68)"`
+	ParentTxnHash string `xorm:"unique(idx_block_no) VARCHAR(66)"`
+	CntrAddr      string `xorm:"VARCHAR(66)"`
+	TxnHash       string `xorm:"index VARCHAR(66)"`
+	FromAddr      string `xorm:"VARCHAR(66)"`
+	ToAddr        string `xorm:"VARCHAR(66)"`
+	TxnType       string `xorm:"VARCHAR(50)"`
+	Value         string `xorm:"default 0 DECIMAL(32)"`
+	GasUsed       string `xorm:"default 0 DECIMAL(32)"`
+	Gas           string `xorm:"default 0 DECIMAL(32)"`
+	Input         []byte `xorm:"BLOB"`
+	Err           string `xorm:"default '' VARCHAR(500)"`
+	Status        int    `xorm:"default 0 INT(11)"`
+}
+
+type EthTxnTransfer struct {
+	Id          int64  `xorm:"pk autoincr BIGINT(20)"`
+	BlockNo     int64  `xorm:"default 0 BIGINT(20)"`
+	BlockHash   string `xorm:"VARCHAR(66)"`
+	TxnHash     string `xorm:"default '' unique(txn_idx) VARCHAR(66)"`
+	TxIndex     int    `xorm:"default 0 unique(txn_idx) INT(11)"`
+	Index       int    `xorm:"default 0 unique(txn_idx) INT(11)"`
+	FromAddr    string `xorm:"default '' VARCHAR(66)"`
+	ToAddr      string `xorm:"default '' VARCHAR(66)"`
+	InputValue  string `xorm:"default 0 DECIMAL(32)"`
+	Topic       []byte `xorm:"BLOB"`
+	Removed     int    `xorm:"default 0 SMALLINT(6)"`
+	CntrAddr    string `xorm:"VARCHAR(64)"`
+	LogCntrAddr string `xorm:"VARCHAR(64)"`
+}
+
+type EthUncleBlock struct {
+	Id            int    `xorm:"not null pk autoincr INT(11)"`
+	CreatedOn     int64  `xorm:"default 0 BIGINT(20)"`
+	BlockNo       int    `xorm:"default 0 index(idx_block_no) INT(11)"`
+	BlockHash     string `xorm:"index(idx_block_no) VARCHAR(68)"`
+	UncleNo       int    `xorm:"default 0 unique(idx_uncle_no) INT(11)"`
+	UncleHash     string `xorm:"unique(idx_uncle_no) VARCHAR(68)"`
+	UnclePosition int    `xorm:"default 0 INT(11)"`
+	Miner         string `xorm:"VARCHAR(50)"`
+	GasUsed       string `xorm:"DECIMAL(11)"`
+	GasLimit      string `xorm:"DECIMAL(11)"`
+	UncleReward   string `xorm:"default 0 DECIMAL(32)"`
+}

+ 0 - 0
queries/themes/example


+ 235 - 0
queries/테이블-create-for-syncscan copy.sql

@@ -0,0 +1,235 @@
+drop table if exists eth_block;
+CREATE TABLE `eth_block` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) DEFAULT 0,
+ `block_no` int(11) DEFAULT 0,
+ `block_hash` varchar(68) DEFAULT NULL,
+ `txn_cnt` int(11) DEFAULT 0 COMMENT '트랜잭션 갯수',
+ `uncle_cnt` int(11) DEFAULT 0 COMMENT '엉클블록 갯수',
+ `miner` varchar(50) DEFAULT NULL COMMENT '채굴 Account Address',
+ `gas_used` decimal(11,0) DEFAULT NULL COMMENT '개스 사용여부 0:아님, 1.:사용',
+ `gas_limit` decimal(11,0) DEFAULT NULL,
+ `trfee_sum` decimal(32,0) DEFAULT NULL COMMENT '트랜잭션 fee 합계',
+ `reward` decimal(32,0) DEFAULT NULL COMMENT '블록 보상액',
+ `uncle_reward` decimal(32,0) DEFAULT 0 COMMENT '엉클블록 보상액',
+ `status` smallint(6) DEFAULT 0 COMMENT '비정상:0, 정상:1',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_block_no` (`block_no`,`block_hash`),
+ KEY `idx_block_hash` (`block_hash`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+drop table if exists eth_cntr_member;
+CREATE TABLE `eth_cntr_member` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) DEFAULT NULL,
+ `updated_on` bigint(20) DEFAULT NULL,
+ `token_name` varchar(128) DEFAULT NULL,
+ `cntr_addr` varchar(64) DEFAULT NULL,
+ `member_id` int(11) NOT NULL,
+ `status` char(16) NOT NULL DEFAULT '0' COMMENT '0:미정, 1:인증',
+ `ip` varchar(16) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+drop table if exists eth_circul_sum;
+CREATE TABLE `eth_circul_sum` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) NOT NULL COMMENT '해당일-Unixtime',
+ `sum_date` char(8) DEFAULT '' COMMENT '집계일자:sum_date+erc_type+cntr_addr->uniqueKey',
+ `erc_type` varchar(10) NOT NULL DEFAULT 0 COMMENT 'main, erc20, erc721, erc1155',
+ `cntr_addr` varchar(64) NOT NULL DEFAULT '' COMMENT 'main 또는 컨트렉트 주소',
+ `daily_circul_sum` decimal(34,0) NOT NULL DEFAULT 0 COMMENT '일유통량',
+ `add_block_cnt` bigint(20) DEFAULT 0 COMMENT '추가된 블록수',
+ `reward_sum` decimal(23,7) DEFAULT 0.0000000 COMMENT '보상합계',
+ `acc_reward_sum` decimal(23,7) DEFAULT 0.0000000 COMMENT '계정별 보상합계',
+ `txn_cnt` int(11) DEFAULT 0 COMMENT '트랜잭션 갯수',
+ `txn_fail_cnt` int(11) DEFAULT 0 COMMENT '실패한트랜잭션 갯수',
+  PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci;
+
+drop table if exists eth_contract;
+CREATE TABLE `eth_contract` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) DEFAULT 0,
+ `txn_hash` varchar(66) DEFAULT NULL,
+ `block_no` bigint(11) DEFAULT NULL,
+ `cntr_addr` varchar(64) DEFAULT NULL COMMENT 'main or 컨트랙트 주소',
+ `creator_addr` varchar(64) DEFAULT NULL,
+ `balance` decimal(16,0) DEFAULT 0,
+ `txn_cnt` int(11) DEFAULT 0,
+ `order_by` tinyint(4) NOT NULL DEFAULT 0 COMMENT '리스트 순서',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_tx_hash` (`txn_hash`),
+ UNIQUE KEY `idx_contract_addr` (`cntr_addr`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+drop table if exists eth_contract_abi;
+CREATE TABLE `eth_contract_abi` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) DEFAULT 0,
+ `cntr_addr` varchar(64) DEFAULT NULL COMMENT '컨트랙트 주소',
+ `cntr_id` int(11) NOT NULL,
+ `member_id` int(11) DEFAULT NULL,
+ `cntr_name` varchar(64) NOT NULL,
+ `compiler` varchar(64) DEFAULT NULL,
+ `version` varchar(64) DEFAULT NULL,
+ `veried` varchar(64) DEFAULT NULL,
+ `license` varchar(64) DEFAULT NULL COMMENT '소유자 입력',
+ `abi_code` mediumtext DEFAULT NULL COMMENT '사용abi 코드 입력',
+ `create_code` mediumtext NOT NULL COMMENT '사용코드 입력',
+ `ip` varchar(20) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+drop table if exists eth_contract_sol;
+CREATE TABLE `eth_contract_sol` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) DEFAULT 0,
+ `cntr_addr` varchar(64) DEFAULT NULL,
+ `cntr_id` int(11) NOT NULL,
+ `member_id` int(11) DEFAULT NULL,
+ `file_name` varchar(256) DEFAULT NULL,
+ `sol_code` mediumtext DEFAULT NULL COMMENT '솔리디티 코드',
+ `ip` varchar(20) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+drop table if exists eth_last_sync;
+CREATE TABLE `eth_last_sync` (
+ `id` int(10) unsigned NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(11) NOT NULL,
+ `updated_on` bigint(11) NOT NULL,
+ `sync_type` varchar(32) NOT NULL,
+ `last_no` varchar(32) NOT NULL DEFAULT '1' COMMENT '마지막 싱크블록 번호를 넣음',
+ `sync_range` varchar(64) NOT NULL,
+ `sync_cnt` int(11) NOT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+drop table if exists eth_token;
+CREATE TABLE `eth_token` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) DEFAULT 0,
+ `update_on` bigint(20) NOT NULL DEFAULT 0,
+ `cntr_addr` varchar(64) DEFAULT NULL,
+ `token_name` varchar(20) DEFAULT NULL,
+ `wei_decimals` smallint(10) DEFAULT NULL COMMENT 'wei단위 적용 소숫점',
+ `curr_bal_qty` decimal(32,0) DEFAULT NULL COMMENT '현재 잔량',
+ `symbol` varchar(21) DEFAULT '' COMMENT '토큰 심볼',
+ `total_circul_qty` decimal(30,0) NOT NULL DEFAULT 0 COMMENT '총공급량',
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_cntr_addr` (`cntr_addr`)
+) ENGINE=InnoDB AUTO_INCREMENT=12 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+drop table if exists eth_token_add;
+CREATE TABLE `eth_token_add` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) DEFAULT 0,
+ `updated_on` bigint(20) DEFAULT 0,
+ `cntr_addr` varchar(64) DEFAULT NULL,
+ `icon_image` varchar(500) DEFAULT NULL,
+ `unit_point` tinyint(4) NOT NULL DEFAULT 0,
+ `decimal_point` tinyint(4) NOT NULL DEFAULT 0,
+ `fee_point` tinyint(4) NOT NULL DEFAULT 0,
+ `token_desc` tinytext DEFAULT NULL,
+ `site_url` varchar(256) DEFAULT NULL,
+ `sns_url` varchar(256) DEFAULT NULL,
+ `token_tracker` varchar(128) DEFAULT NULL,
+ `ip` varchar(20) DEFAULT NULL,
+ PRIMARY KEY (`id`)
+) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+drop table if exists eth_token_holder;
+CREATE TABLE `eth_token_holder` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) DEFAULT 0,
+ `cntr_addr` varchar(66) DEFAULT NULL,
+ `holder_addr` varchar(66) DEFAULT NULL,
+ `total_sum` decimal(30,0) DEFAULT NULL,
+ `last_sum` decimal(30,0) DEFAULT 0,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_token_holder` (`cntr_addr`,`holder_addr`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+drop table if exists eth_trans_inter;
+CREATE TABLE `eth_trans_inter` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) DEFAULT 0,
+ `block_no` int(11) DEFAULT NULL,
+ `block_hash` varchar(68) DEFAULT NULL,
+ `parent_txn_hash` varchar(66) DEFAULT NULL,
+ `cntr_addr` varchar(66) DEFAULT NULL,
+ `txn_hash` varchar(66) DEFAULT NULL,
+ `from_addr` varchar(66) DEFAULT NULL,
+ `to_addr` varchar(66) DEFAULT NULL,
+ `txn_type` varchar(50) DEFAULT NULL,
+ `value` decimal(32,0) DEFAULT 0,
+ `gas_used` decimal(32,0) DEFAULT 0,
+ `gas` decimal(32,0) DEFAULT 0,
+ `input` blob DEFAULT NULL,
+ `err` varchar(500) DEFAULT '',
+ `status` int(11) DEFAULT 0,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_block_no` (`block_no`,`block_hash`,`parent_txn_hash`),
+ KEY `idx_hash` (`txn_hash`)
+) ENGINE=InnoDB AUTO_INCREMENT=10 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+drop table if exists eth_trans_inter;
+CREATE TABLE `eth_tranxn` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) DEFAULT 0,
+ `block_no` int(11) DEFAULT NULL,
+ `block_hash` varchar(66) DEFAULT NULL,
+ `txn_hash` varchar(66) DEFAULT NULL,
+ `cntr_addr` varchar(66) DEFAULT NULL,
+ `from_addr` varchar(66) DEFAULT NULL,
+ `to_addr` varchar(66) DEFAULT NULL,
+ `txn_type` varchar(50) DEFAULT NULL,
+ `txn_symbol` varchar(120) NOT NULL DEFAULT '',
+ `value` decimal(32,0) DEFAULT 0,
+ `input_value` decimal(32,0) NOT NULL DEFAULT 0,
+ `txn_fee` decimal(16,8) DEFAULT 0.00000000,
+ `input` blob DEFAULT NULL,
+ `gas_used` decimal(11,0) NOT NULL DEFAULT 0,
+ `status` int(11) NOT NULL DEFAULT -1,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_hash` (`txn_hash`),
+ KEY `cntr_addr` (`cntr_addr`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;
+
+drop table if exists eth_txn_transfer;
+CREATE TABLE `eth_txn_transfer` (
+ `id` bigint(20) NOT NULL AUTO_INCREMENT,
+ `block_no` bigint(20) DEFAULT 0,
+ `block_hash` varchar(66) DEFAULT NULL,
+ `txn_hash` varchar(66) DEFAULT '',
+ `tx_index` int(11) DEFAULT 0,
+ `index` int(11) DEFAULT 0,
+ `from_addr` varchar(66) DEFAULT '',
+ `to_addr` varchar(66) DEFAULT '',
+ `input_value` decimal(32,0) DEFAULT 0,
+ `topic` blob DEFAULT NULL,
+ `removed` smallint(6) DEFAULT 0,
+ `cntr_addr` varchar(64) DEFAULT NULL,
+ `log_cntr_addr` varchar(64) DEFAULT NULL,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `txn_idx` (`txn_hash`,`tx_index`,`index`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb3 COLLATE=utf8mb3_general_ci;
+
+drop table if exists eth_uncle_block;
+CREATE TABLE `eth_uncle_block` (
+ `id` int(11) NOT NULL AUTO_INCREMENT,
+ `created_on` bigint(20) DEFAULT 0,
+ `block_no` int(11) DEFAULT 0,
+ `block_hash` varchar(68) DEFAULT NULL,
+ `uncle_no` int(11) DEFAULT 0,
+ `uncle_hash` varchar(68) DEFAULT NULL,
+ `uncle_position` int(11) DEFAULT 0,
+ `miner` varchar(50) DEFAULT NULL,
+ `gas_used` decimal(11,0) DEFAULT NULL,
+ `gas_limit` decimal(11,0) DEFAULT NULL,
+ `uncle_reward` decimal(32,0) DEFAULT 0,
+ PRIMARY KEY (`id`),
+ UNIQUE KEY `idx_uncle_no` (`uncle_no`,`uncle_hash`),
+ KEY `idx_block_no` (`block_no`,`block_hash`)
+) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;

+ 14 - 0
queries/테이블-show-create-for-syncscan.sql

@@ -0,0 +1,14 @@
+truncate eth_cntr_member;
+truncate eth_block;
+truncate eth_circul_sum;
+truncate eth_contract;
+truncate eth_contract_abi;
+truncate eth_contract_sol;
+truncate eth_last_sync;
+truncate eth_token;
+truncate eth_token_add;
+truncate eth_token_holder;
+truncate eth_trans_inter;
+truncate eth_tranxn;
+truncate eth_txn_transfer;
+truncate eth_uncle_block;

+ 240 - 0
routers/init-a_router-func.go

@@ -0,0 +1,240 @@
+package routers
+
+import (
+	"bytes"
+	"encoding/json"
+	"errors"
+	"io/ioutil"
+	controllers_func "kkscrap-go/controllers/func"
+	controllers_scraper "kkscrap-go/controllers/scraper"
+	"kkscrap-go/locals"
+	models_table "kkscrap-go/models/table"
+
+	"github.com/dabory/abango-rest"
+	e "github.com/dabory/abango-rest/etc"
+	"github.com/labstack/echo"
+	"github.com/labstack/echo/middleware"
+)
+
+type Route struct {
+	Method  []string
+	Path    string
+	Handler echo.HandlerFunc
+}
+
+var routes []Route
+
+func AddRoute(route Route) {
+	routes = append(routes, route)
+}
+
+func RestRouterInit(ask *abango.AbangoAsk) {
+
+	//main.go 에서는 XConfig 값을 받아 올수 없으므로 여기서 모든걸 세팅한다.
+
+	c := echo.New()
+	// c.Pre(middleware.BodyDump(func(c echo.Context, reqBody, resBody []byte) {
+
+	c.Use(middleware.CORSWithConfig(middleware.CORSConfig{
+		AllowOrigins: []string{"*"},
+		// AllowOrigins: []string{"http://single.daboryhost.com", "http://fit-vac.com",
+		AllowHeaders: []string{echo.HeaderOrigin, echo.HeaderContentType, echo.HeaderAccept},
+	}))
+	c.Pre(func(next echo.HandlerFunc) echo.HandlerFunc {
+		return func(c echo.Context) error {
+			r := c.Request()
+			uri := r.URL.Path
+
+			var l models_table.DbtLogAccess //변수재사용을 위하여, 실제 로그 기록은 소스 맨 아래에서 AddaRow함.
+			l.CreatedOn = e.GetNowUnix()
+			l.FrontIp = c.RealIP()
+			l.Url = uri
+			l.FrontHost = r.Header.Get("FrontendHost")
+			l.RemoteIp = r.Header.Get("RemoteIp")
+			l.Referer = r.Header.Get("Referer")
+
+			e.OkLog(".")
+			e.OkLog("Start >> " + l.Url + " FROM (" + l.FrontIp + ") " + l.FrontHost + " <- " + l.RemoteIp)
+
+			bodyBytes, err := ioutil.ReadAll(r.Body)
+			if err == nil { // Remove when production completes
+				e.OkLog("Requested Json: " + string(bodyBytes))
+				r.Body = ioutil.NopCloser(bytes.NewBuffer(bodyBytes)) // This leads ReadCloser rewinded
+			}
+
+			// 미들웨어에서 receiver 받은 것을 echo.Context 로 넘겨줌.
+			var abg abango.Controller
+			// var err error
+
+			if uri != "/gate-token-get" { // 미리 GateToken이 있는지 확인함.
+				abg.GateToken = r.Header.Get("GateToken")
+				if status, msg := abg.Init(); status != 200 {
+					return c.String(status, msg)
+				}
+				if err := CheckAppPerm(&abg, uri); err != nil { //SsoSubId로 들어온 App 계정체크
+					return c.String(508, "App Permission Denied: "+err.Error())
+				}
+			}
+
+			if uri == "/gate-token-get" { // gate-token-test 는 아웃풋없는 test 이므로 여기 없음.
+				var v controllers_func.GateTokenGetReq
+				err = json.NewDecoder(r.Body).Decode(&v)
+				c.Set("receiver", v)
+
+			} else if uri == "/gate-token-test" {
+				var v controllers_func.GateTokenTestReq
+				err = json.NewDecoder(r.Body).Decode(&v)
+				c.Set("receiver", v)
+
+			} else if uri == "/item-url-scrap" {
+				var v controllers_scraper.ItemUrlScrapReq
+				err = json.NewDecoder(r.Body).Decode(&v)
+				c.Set("receiver", v)
+
+			} else if uri == "/solution-type-get" {
+				var v controllers_scraper.SolutionTypeGetReq
+				err = json.NewDecoder(r.Body).Decode(&v)
+				c.Set("receiver", v)
+
+			} else if uri == "/product-page-get" {
+				var v controllers_scraper.ProductPageGetReq
+				err = json.NewDecoder(r.Body).Decode(&v)
+				c.Set("receiver", v)
+
+			} else { //!!주의 긴 string이 먼저나오게 지정할 것
+				if locals.HasPickActPage(uri, "dummydummy") {
+				} else {
+					return c.String(709, e.LogStr("ewgvdafewwa", "Request Function Not Found in Middleware for "+uri))
+				}
+			}
+
+			if err != nil { // error 처리를 반복하지 않고 하나로 처리
+				return c.String(800, e.JsonFormatErr("wevzxdfarfawe", uri)+" "+err.Error())
+			}
+
+			// if uri[len(uri)-4:] == "-act" {
+			// 	var mapped map[string]interface{}
+			// 	// id 번호 구함.
+			// 	inxId := bytes.Index(bodyBytes, []byte("\"Id\""))
+			// 	inxIdStart := 1 + inxId + bytes.Index(bodyBytes[inxId:], []byte(":"))
+			// 	inxIdEnd := inxIdStart + bytes.Index(bodyBytes[inxIdStart:], []byte(","))
+
+			// 	if inxIdStart > inxIdEnd { //Delete 는 { "Id": -152 } 형태이므로 , 가 없다.
+			// 		inxIdEnd = inxIdStart + bytes.Index(bodyBytes[inxIdStart:], []byte("}"))
+			// 	}
+			// 	// fmt.Println("inxIdStart2:", inxIdStart)
+			// 	// fmt.Println("inxIdEnd2", inxIdEnd)
+
+			// 	idChar := string(bodyBytes[inxIdStart:inxIdEnd])
+			// 	if idChar[len(idChar)-1:] == "}" { //{"Id": -1541}, 다중 레코드의 경우도 처리
+			// 		idChar = idChar[:len(idChar)-1]
+			// 	}
+			// 	strId := strings.TrimSpace(idChar)
+			// 	intId, err := strconv.Atoi(strId)
+			// 	// fmt.Println("strId=", strId)
+			// 	if err != nil { // Id 가 정수가 아니면 치명적에러 이다. // ** 입력,수정,삭제를 복합적으로 한번에 request하는 것은 처리 안됨.
+			// 		return c.String(800, e.JsonFormatErr("0qjhoysaee", "Id value is not a integer "+err.Error()))
+			// 	}
+
+			// 	if intId > 0 { //id > 0 경우는 update인 경우만 처리한다.
+			// 		inxPage := bytes.Index(bodyBytes, []byte("\"Page\""))
+			// 		inxCoreStart := inxPage + bytes.Index(bodyBytes[inxPage:], []byte("{"))
+
+			// 		//Json 필드를 찾기 Skip 하기 위한 부분인데 만약 Json Field가 2개이상이면 For문으로 업그레이드  필요.
+			// 		// 현재는 setup-act 와 eyetest-act의 경우를 처리함.
+			// 		inxCoreJson := bytes.Index(bodyBytes, []byte("}\"")) //Json필드의 마지막은 이렇게 저장된다.
+			// 		inxCoreEnd := 0
+			// 		if inxCoreJson <= inxCoreStart { //Json 필드 없는 경우
+			// 			inxCoreEnd = 1 + bytes.Index(bodyBytes, []byte("}"))
+			// 		} else { //Json 필드 있는 경우
+			// 			inxCoreJson = 1 + inxCoreJson
+			// 			inxCoreEnd = 1 + inxCoreJson + bytes.Index(bodyBytes[inxCoreJson:], []byte("}"))
+			// 		}
+			// 		// fmt.Println("core:", string(bodyBytes[inxCoreStart:inxCoreEnd]))
+			// 		if err := json.Unmarshal(bodyBytes[inxCoreStart:inxCoreEnd], &mapped); err != nil {
+			// 			return c.String(800, e.JsonFormatErr("903uous09ur", uri))
+			// 		}
+
+			// 		update := ""
+			// 		for fld := range mapped {
+			// 			update += e.SnakeString(fld) + ","
+			// 		}
+
+			// 		abg.UpdateFieldList = update[0 : len(update)-1] //마지막 , 하니떼고
+			// 		// fmt.Println("UpdateFieldList:", abg.UpdateFieldList)
+			// 	}
+			// }
+			// }
+			// c.Set("abango", abg) // 미들웨어에서 y.Db를 접속한 후 echo.Context 로 넘겨줌.
+			//Log 기록 _setup반영요
+			// if abg.GateToken != "" { //GateToken 이 있는 경우,유효 Request만 로그를 TargetDB에 쓸수가 있슴
+			// 	l.MemberId = abg.Gtb.MemberId
+			// 	l.UserId = abg.Gtb.UserId
+			// 	if err := l.AddaRow(&abg); err != nil {
+			// 		return c.String(603, err.Error())
+			// 	}
+			// }
+			err1 := next(c)
+			// fmt.Println("Pre 2번 미들웨어 종료")
+			return err1
+		}
+	})
+
+	c.Use(middleware.LoggerWithConfig(middleware.LoggerConfig{
+		Format: "Finish >> method=${method}, uri=${uri}, status=${status} \n",
+	}))
+
+	for _, r := range routes {
+		c.Match(r.Method, r.Path, r.Handler)
+	}
+
+	// c.Static("/.well-known/acme-challenge", "/home/.well-known/acme-challenge")
+	xc := abango.XConfig
+	if xc["SslMode"] == "Yes" {
+		e.OkLog("SSL(HTTPS) Mode Started !!")
+		//API Server 포트가 443: "https://api.dabory.com", 40443 포트: "https://api.dabory.com"
+		c.Logger.Fatal(c.StartTLS(xc["SslConnect"], xc["SslFullChain"], xc["SslPrivate"]))
+	} else {
+		e.OkLog("PLAIN(HTTP) Mode Started !!")
+		c.Logger.Fatal(c.Start(abango.XConfig["RestConnect"]))
+	}
+}
+
+func CheckAppPerm(y *abango.Controller, uri string) error {
+
+	if y.Gtb.SsoSubId == 0 {
+		return nil
+	}
+
+	var qName string //이쿼리 queries 필드에거 가져와서 진행할 수 있도록 할 것.
+	sql := `select
+			mx.id
+		from
+			pro_member_app as mx
+			inner join pro_app_perm as prm on mx.app_perm_id = prm.id
+			inner join pro_app_perm_bd  as bdy on prm.id = bdy.app_perm_id
+			inner join pro_app_api  as api on api.id = bdy.app_api_id
+		where 
+			mx.sso_sub_id = ? and api.api_uri = ?`
+
+	// qName = "kkk"
+	//나중에 "QueryName 찾는 로직도 넣을 것
+	if qName != "" {
+		sql += " and api.query_name = '" + qName + "'"
+	}
+
+	// fmt.Println("y.Gtb.SsoSubId,", y.Gtb.SsoSubId)
+	// fmt.Println("uri: ", uri)
+	// fmt.Println("sql: ", sql)
+	arr, err := y.Db.Query(sql, y.Gtb.SsoSubId, uri)
+	if err != nil {
+		return e.LogErr("3f0oijhbfre", "Query issue. ", err)
+	}
+
+	if len(arr) == 1 {
+		return nil
+	} else {
+		return e.LogErr("34445ef34r", "App Api Record Issue ", errors.New(""))
+	}
+
+}

+ 5 - 0
routers/init-book-and-page.go

@@ -0,0 +1,5 @@
+package routers
+
+func init() {
+
+}

+ 18 - 0
routers/init-func.go

@@ -0,0 +1,18 @@
+package routers
+
+import (
+	controllers_func "kkscrap-go/controllers/func"
+	controllers_scraper "kkscrap-go/controllers/scraper"
+)
+
+func init() {
+
+	AddRoute(Route{[]string{"POST"}, "/product-page-get", controllers_scraper.ProductPageGet})
+	AddRoute(Route{[]string{"POST"}, "/solution-type-get", controllers_scraper.SolutionTypeGet})
+
+	AddRoute(Route{[]string{"POST"}, "/item-url-scrap", controllers_scraper.ItemUrlScrap})
+
+	AddRoute(Route{[]string{"POST"}, "/gate-token-test", controllers_func.GateTokenTest})
+	AddRoute(Route{[]string{"POST"}, "/gate-token-get", controllers_func.GateTokenGet})
+
+}

+ 5 - 0
routers/init-join.go

@@ -0,0 +1,5 @@
+package routers
+
+func init() {
+
+}

+ 6 - 0
routers/init_table/a-tri-init.go

@@ -0,0 +1,6 @@
+package routers_init_table
+
+func Init() {
+	// 현재 필드의 모든 init{} 를 실행하기 위한 Dummy function
+	//routers_init_themes.Init() main 에 이렇게 걸려야 404 안뜸.
+}

+ 6 - 0
routers/init_themes/a-iri-init.go

@@ -0,0 +1,6 @@
+package routers_init_themes
+
+func Init() {
+	// 현재 필드의 모든 init{} 를 실행하기 위한 Dummy function
+	//routers_init_themes.Init() main 에 이렇게 걸려야 404 안뜸.
+}

+ 14 - 0
runner.conf

@@ -0,0 +1,14 @@
+root:              . 
+tmp_path:          ./tmp 
+build_name:        runner-build
+build_log:         runner-build-errors.log
+valid_ext:         .go, .tpl, .tmpl, .html
+no_rebuild_ext:    .tpl, .tmpl, .html
+ignored:           shell, queries, query-themes, conf, conf-copy, .vscode, assets, tmp, vendor, queries, shell, .git
+build_delay:       0
+colors:            1
+log_color_main:    cyan
+log_color_build:   yellow
+log_color_runner:  green
+log_color_watcher: magenta
+log_color_app:

+ 17 - 0
runner.conf.README.md

@@ -0,0 +1,17 @@
+# gRPC KangAn How to
+
+## Running the server and client
+
+Note : Do not delete runner.conf !
+When you copy the folder to the other folder, fresh command in docker-compose would not work
+because root folder of the fresh is not written in docker by default. So you need to run 
+
+`$ fresh -c runner.conf
+
+`$ dkcu or docker-compose up -d
+
+then it is to be affected by changing codes in the folder for compiling go lang codes automatically
+
+!! (1) change runner.conf -> (2) run fresh successfully -> (3) fresh working properly.
+
+  ◀◀ ◁◁  ▷▷ ▶▶

+ 6 - 0
shell/apply-gitignore-after-git-created.sh

@@ -0,0 +1,6 @@
+#!/bin/bash
+
+git rm -r --cached .
+git add .
+git commit -m "Apply .gitignore"
+git push

+ 9 - 0
shell/dkcu-compose-up.sh

@@ -0,0 +1,9 @@
+#! /bin/bash
+if [ $# -eq 0 ]
+  then
+    dfile="docker-compose"
+else
+    dfile=$1
+fi
+
+docker-compose -f $dfile.yml up

+ 3 - 0
shell/dkrmc-remove-all-containers.sh

@@ -0,0 +1,3 @@
+#! /bin/bash
+docker container stop $(docker container ls –aq) 
+

Some files were not shown because too many files changed in this diff