Compare commits
265 Commits
cac0161585
...
0657307265
Author | SHA1 | Date | |
---|---|---|---|
|
0657307265 | ||
|
59edb394fa | ||
|
3be83ed424 | ||
|
743ea96157 | ||
|
222b9ec155 | ||
|
932ee1a578 | ||
|
b0f598af68 | ||
|
d0fc91b61b | ||
|
17aac7ad66 | ||
|
9c72a8a4c9 | ||
|
a4164dbdf6 | ||
|
5fadf0697d | ||
|
25c3de6b99 | ||
|
b28fefdb0e | ||
|
148e0681ec | ||
|
fc59840235 | ||
|
9d4bbbf80b | ||
|
7e22f47a0d | ||
|
7ec78d1c35 | ||
|
4c2f823178 | ||
|
98ae3e2106 | ||
|
900d5bf24b | ||
|
b0c9c8d310 | ||
|
1e2f6d8b7f | ||
|
72a6412eed | ||
|
f4def7f8a0 | ||
|
3201f4d26d | ||
|
6b3ad339c6 | ||
|
a65efe5777 | ||
|
80a94de6df | ||
|
9400fcfaeb | ||
|
91131161c9 | ||
|
001716785d | ||
|
fef5d33f08 | ||
|
83fc1b30c7 | ||
|
133af63064 | ||
|
53a4df065c | ||
|
0b5270f3b7 | ||
|
efde0005f9 | ||
|
2825f8ae54 | ||
|
373d5dca45 | ||
|
0311bf82fc | ||
|
7e4708e8d8 | ||
|
50817d7ae2 | ||
|
eb25e5bfcc | ||
|
4e13550044 | ||
|
b36ad4bd25 | ||
|
985fc93d00 | ||
|
44a3666d68 | ||
|
bfa1872595 | ||
|
d7dc0406f6 | ||
|
3d678dc243 | ||
|
8a4f990214 | ||
|
4fbfd90c0d | ||
|
edd4104ce7 | ||
|
728aeb17e2 | ||
|
65d0663d28 | ||
|
532929a563 | ||
|
10aa0d14f0 | ||
|
0e752e31fd | ||
|
2f5ce8dd77 | ||
|
421b63846a | ||
|
0e72027ff3 | ||
|
fd1a56c11a | ||
|
7c2762065c | ||
|
8258dfa8c1 | ||
|
903891000a | ||
|
b93c2d4708 | ||
|
8a1209c6f0 | ||
|
5ef3b40dfe | ||
|
810f4fbee7 | ||
|
20e32ae078 | ||
|
92110e02a6 | ||
|
4a1655d6fa | ||
|
bf3d9f9631 | ||
|
06349aafa7 | ||
|
8c7884bcc3 | ||
|
9ff4468778 | ||
|
f2eec528ce | ||
|
52d47f78ac | ||
|
4a2230d90c | ||
|
fd93688d27 | ||
|
b8333ecaf8 | ||
|
3e1d4d2e4f | ||
|
6264440017 | ||
|
47e22e6891 | ||
|
3bd08c8c2b | ||
|
31132364ad | ||
|
3ef96dab13 | ||
|
37078d5772 | ||
|
99bd3592af | ||
|
d4c77b2a13 | ||
|
c49874fec7 | ||
|
7ebc7f8476 | ||
|
e24fc4825c | ||
|
20a7149eb6 | ||
|
a3151acb70 | ||
|
9647fe060a | ||
|
12bc736d49 | ||
|
db15103c93 | ||
|
bd127a7884 | ||
|
245122d049 | ||
|
f09220cf2d | ||
|
52d3767256 | ||
|
a62b8692f5 | ||
|
545192b8ac | ||
|
620257e0c5 | ||
|
ad60c63e2c | ||
|
d466364385 | ||
|
c6f445708d | ||
|
e3373bde65 | ||
|
c13225d2fa | ||
|
e4e9339071 | ||
|
125de6dde8 | ||
|
4d9f14eb30 | ||
|
9e7b3267aa | ||
|
e1bc5fbe51 | ||
|
eedce6c2d7 | ||
|
2eb8bf936f | ||
|
73ce1e6db3 | ||
|
fffdf448c4 | ||
|
ae1b3e1e64 | ||
|
46418f2338 | ||
|
46430a1ce6 | ||
|
e837c745b1 | ||
|
edd3d7353d | ||
|
0db42491ae | ||
|
3a6ab7a666 | ||
|
d122f9b0c0 | ||
|
86a2deacfb | ||
|
56a8b32d90 | ||
|
6d3a3b2dda | ||
|
52f65afe1a | ||
|
6cd5a6d0e8 | ||
|
e4925c2194 | ||
|
0f96eaac30 | ||
|
b9f8876fde | ||
|
16dbf3cb0d | ||
|
4dbb77b306 | ||
|
2fa77828b4 | ||
|
3c9fb417aa | ||
|
cf59a03129 | ||
|
55eabd5cae | ||
|
a4f429a528 | ||
|
e0de8bfcf2 | ||
|
d20a1b0354 | ||
|
3d60f7053e | ||
|
ccf1ae19b2 | ||
|
d2766d5bd3 | ||
|
98c5727c7e | ||
|
406d62a894 | ||
|
aabf8faca7 | ||
|
bb18b5effa | ||
|
8e207ef600 | ||
|
43e2e835eb | ||
|
fb06995b26 | ||
|
f0277f6a40 | ||
|
8c2cfcb37b | ||
|
dea09094b7 | ||
|
9bcb1d9377 | ||
|
22d0f6a5b1 | ||
|
5f3d6eb120 | ||
|
b06a8e8da2 | ||
|
f07e4a2084 | ||
|
f9bfbf28ae | ||
|
852fca2afa | ||
|
6b96a3ecbe | ||
|
fb4414fab6 | ||
|
8f95be2ba5 | ||
|
53175d539c | ||
|
e16222849c | ||
|
f5b3fedee3 | ||
|
2681c10b4c | ||
|
0db491bc01 | ||
|
d8b43a7f83 | ||
|
53c349413c | ||
|
00e2d4b16b | ||
|
27dfa0a2bf | ||
|
7818b88b70 | ||
|
975fe89eca | ||
|
70fd711fa5 | ||
|
3b462edc89 | ||
|
0a5da30062 | ||
|
d64eb320ed | ||
|
791121c574 | ||
|
2b1728aac5 | ||
|
1c74c0ea4b | ||
|
c1de53c098 | ||
|
83bfa8977c | ||
|
2af55fb898 | ||
|
c45028b914 | ||
|
f7ed913470 | ||
|
78c09f1b40 | ||
|
6337371cd1 | ||
|
c6005983f8 | ||
|
3614e90e99 | ||
|
31d22cda63 | ||
|
7e9cdbfb57 | ||
|
88bd7798b8 | ||
|
22b27141a4 | ||
|
5934017dbf | ||
|
07121d0294 | ||
|
9a840f420e | ||
|
c17ab5ae5c | ||
|
5ac62e7c55 | ||
|
7d386237fb | ||
|
9b56d7ba51 | ||
|
9f865eb1c5 | ||
|
81a64b2129 | ||
|
f09e1b8f93 | ||
|
543308ddbc | ||
|
519d9952e0 | ||
|
02c41a5069 | ||
|
c422f493f4 | ||
|
58d02d0d50 | ||
|
8ba8a67dfb | ||
|
d4e75b1efc | ||
|
d5b829c212 | ||
|
979df28ae2 | ||
|
6abca6b271 | ||
|
b012db8e4e | ||
|
5b9a814fbb | ||
|
19f41f6dbc | ||
|
0851c922ef | ||
|
13c5a45a5e | ||
|
84088a7a12 | ||
|
66ed487249 | ||
|
9050b4ab0e | ||
|
3a2fb3bc5d | ||
|
c5bcf9d676 | ||
|
116171dddd | ||
|
d336f757ed | ||
|
6d8bdcb2a6 | ||
|
00873a7654 | ||
|
17d1522655 | ||
|
6d842cfc64 | ||
|
a101764dcb | ||
|
d74d27ab2d | ||
|
42314b9807 | ||
|
f3eea7f664 | ||
|
7f71afd8b0 | ||
|
0afaed5089 | ||
|
150ae1df77 | ||
|
acc756f9cc | ||
|
4d4996c6f4 | ||
|
8fae3400d3 | ||
|
1a0156c686 | ||
|
96c43325c0 | ||
|
edda375a53 | ||
|
5116b06f2f | ||
|
15eb99d975 | ||
|
d876884397 | ||
|
002ec9d292 | ||
|
a5ea734eb0 | ||
|
6bfa46e990 | ||
|
305bf83d4e | ||
|
4d4381b196 | ||
|
81b315b12b | ||
|
cd8a578dfe | ||
|
1a48387e92 | ||
|
aceb4c926f | ||
|
efe02a0355 | ||
|
32d368816e | ||
|
8bd6f019ba | ||
|
d987601afd |
26
.gitignore
vendored
26
.gitignore
vendored
@ -14,7 +14,6 @@
|
|||||||
# Dependency directories (remove the comment below to include it)
|
# Dependency directories (remove the comment below to include it)
|
||||||
# vendor/
|
# vendor/
|
||||||
|
|
||||||
|
|
||||||
#vscode
|
#vscode
|
||||||
|
|
||||||
.vscode/*
|
.vscode/*
|
||||||
@ -30,4 +29,27 @@
|
|||||||
# Built Visual Studio Code Extensions
|
# Built Visual Studio Code Extensions
|
||||||
*.vsix
|
*.vsix
|
||||||
|
|
||||||
__debug_bin
|
__debug_bin
|
||||||
|
__debug_bin*
|
||||||
|
|
||||||
|
.idea
|
||||||
|
.vscode
|
||||||
|
|
||||||
|
screenlog.*
|
||||||
|
*.txt
|
||||||
|
|
||||||
|
proxyserver/proxyserver
|
||||||
|
|
||||||
|
server/backend/backend
|
||||||
|
server/canteen/canteen
|
||||||
|
server/data-transfer/data-transfer
|
||||||
|
server/home-user-auth/home-user-auth
|
||||||
|
server/inventory/inventory
|
||||||
|
server/map-library/map-library
|
||||||
|
server/orders/orders
|
||||||
|
server/product/product
|
||||||
|
server/product-model/product-model
|
||||||
|
server/product-template/product-template
|
||||||
|
server/shopping-cart-confirmation/shopping-cart-confirmation
|
||||||
|
server/upload/upload
|
||||||
|
server/webset/webset
|
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
@ -1,8 +0,0 @@
|
|||||||
# Default ignored files
|
|
||||||
/shelf/
|
|
||||||
/workspace.xml
|
|
||||||
# Datasource local storage ignored files
|
|
||||||
/dataSources/
|
|
||||||
/dataSources.local.xml
|
|
||||||
# Editor-based HTTP Client requests
|
|
||||||
/httpRequests/
|
|
9
.idea/fusenapi.iml
generated
9
.idea/fusenapi.iml
generated
@ -1,9 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<module type="WEB_MODULE" version="4">
|
|
||||||
<component name="Go" enabled="true" />
|
|
||||||
<component name="NewModuleRootManager">
|
|
||||||
<content url="file://$MODULE_DIR$" />
|
|
||||||
<orderEntry type="inheritedJdk" />
|
|
||||||
<orderEntry type="sourceFolder" forTests="false" />
|
|
||||||
</component>
|
|
||||||
</module>
|
|
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@ -1,8 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectModuleManager">
|
|
||||||
<modules>
|
|
||||||
<module fileurl="file://$PROJECT_DIR$/.idea/fusenapi.iml" filepath="$PROJECT_DIR$/.idea/fusenapi.iml" />
|
|
||||||
</modules>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@ -1,6 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="VcsDirectoryMappings">
|
|
||||||
<mapping directory="$PROJECT_DIR$" vcs="Git" />
|
|
||||||
</component>
|
|
||||||
</project>
|
|
29
.idea/watcherTasks.xml
generated
29
.idea/watcherTasks.xml
generated
@ -1,29 +0,0 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project version="4">
|
|
||||||
<component name="ProjectTasksOptions">
|
|
||||||
<TaskOptions isEnabled="true">
|
|
||||||
<option name="arguments" value="fmt $FilePath$" />
|
|
||||||
<option name="checkSyntaxErrors" value="true" />
|
|
||||||
<option name="description" />
|
|
||||||
<option name="exitCodeBehavior" value="ERROR" />
|
|
||||||
<option name="fileExtension" value="go" />
|
|
||||||
<option name="immediateSync" value="false" />
|
|
||||||
<option name="name" value="go fmt" />
|
|
||||||
<option name="output" value="$FilePath$" />
|
|
||||||
<option name="outputFilters">
|
|
||||||
<array />
|
|
||||||
</option>
|
|
||||||
<option name="outputFromStdout" value="false" />
|
|
||||||
<option name="program" value="$GoExecPath$" />
|
|
||||||
<option name="runOnExternalChanges" value="false" />
|
|
||||||
<option name="scopeName" value="Project Files" />
|
|
||||||
<option name="trackOnlyRoot" value="true" />
|
|
||||||
<option name="workingDir" value="$ProjectFileDir$" />
|
|
||||||
<envs>
|
|
||||||
<env name="GOROOT" value="$GOROOT$" />
|
|
||||||
<env name="GOPATH" value="$GOPATH$" />
|
|
||||||
<env name="PATH" value="$GoBinDirs$" />
|
|
||||||
</envs>
|
|
||||||
</TaskOptions>
|
|
||||||
</component>
|
|
||||||
</project>
|
|
29
change_port.sh
Normal file
29
change_port.sh
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
#!/bin/bash
|
||||||
|
|
||||||
|
# 定义一个函数来修改每个服务器的配置文件中的端口
|
||||||
|
change_port() {
|
||||||
|
server_name=$1
|
||||||
|
port=$2
|
||||||
|
config_file="server/${server_name}/etc/${server_name}.yaml"
|
||||||
|
|
||||||
|
echo "Changing port for $server_name to $port"
|
||||||
|
|
||||||
|
if [ -f "$config_file" ]; then
|
||||||
|
# 使用 sed 将 Port 替换为新的端口
|
||||||
|
sed -i "s/^Port: .*$/Port: $port/" "$config_file"
|
||||||
|
else
|
||||||
|
echo "Configuration file $config_file not found"
|
||||||
|
fi
|
||||||
|
}
|
||||||
|
|
||||||
|
# 列出所有服务器目录
|
||||||
|
server_dirs=("backend" "canteen" "data-transfer" "home-user-auth" "inventory" "map-library" "orders" "product" "product-model" "product-template" "shopping-cart-confirmation" "upload" "webset")
|
||||||
|
|
||||||
|
# 初始化端口为 9901
|
||||||
|
port=9901
|
||||||
|
|
||||||
|
# 遍历服务器目录,修改每个服务器的配置文件中的端口
|
||||||
|
for server_dir in "${server_dirs[@]}"; do
|
||||||
|
change_port $server_dir $port
|
||||||
|
port=$((port + 1))
|
||||||
|
done
|
26
constants/cloud_order.go
Normal file
26
constants/cloud_order.go
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
type cloud int64
|
||||||
|
|
||||||
|
// 已下单
|
||||||
|
const STATUS_ORDERD cloud = 1
|
||||||
|
|
||||||
|
// 运输中
|
||||||
|
const STATUS_SHIPPING cloud = 2
|
||||||
|
|
||||||
|
// ups待提货
|
||||||
|
const STATUS_PICK_UP cloud = 3
|
||||||
|
|
||||||
|
// 已到达
|
||||||
|
const STATUS_ARRIVAL cloud = 4
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 状态对应中文
|
||||||
|
* @var string[]
|
||||||
|
*/
|
||||||
|
var CloudOrderMap = map[cloud]string{
|
||||||
|
STATUS_ORDERD: "已下单",
|
||||||
|
STATUS_SHIPPING: "运输中",
|
||||||
|
STATUS_PICK_UP: "UPS已发货",
|
||||||
|
STATUS_ARRIVAL: "已到达",
|
||||||
|
}
|
6
constants/concact_service.go
Normal file
6
constants/concact_service.go
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
type ConcactService string
|
||||||
|
|
||||||
|
const TYPE_DEFAULT ConcactService = "default"
|
||||||
|
const TYPE_ORDER ConcactService = "order"
|
14
constants/faq.go
Normal file
14
constants/faq.go
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
type TypeFaq int64
|
||||||
|
|
||||||
|
const FAQ_STATUS_ON TypeFaq = 1
|
||||||
|
const FAQ_STATUS_OFF TypeFaq = 0
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 定义类型
|
||||||
|
*/
|
||||||
|
const FAQ_TAG_ORDER TypeFaq = 1
|
||||||
|
const FAQ_TAG_SHIPPING TypeFaq = 2
|
||||||
|
const FAQ_TAG_PAYMENT TypeFaq = 3
|
||||||
|
const FAQ_TAG_RETURN TypeFaq = 4
|
4
constants/image_cropping.go
Normal file
4
constants/image_cropping.go
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
// 裁剪尺寸阶梯
|
||||||
|
var IMAGE_CROPPING_STEP_SIZE = []int{200, 400, 600, 800}
|
16
constants/material.go
Normal file
16
constants/material.go
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
// 材料类型
|
||||||
|
var MAP_MATERIAL = map[int64]string{
|
||||||
|
1: "paper",
|
||||||
|
2: "glass",
|
||||||
|
3: "塑料",
|
||||||
|
4: "牛皮纸",
|
||||||
|
5: "单层牛皮纸",
|
||||||
|
6: "双层牛皮纸",
|
||||||
|
7: "PET",
|
||||||
|
8: "瓦楞纸",
|
||||||
|
9: "厚牛皮纸",
|
||||||
|
10: "卡纸",
|
||||||
|
11: "PP",
|
||||||
|
}
|
@ -121,3 +121,26 @@ const (
|
|||||||
// 云仓完成
|
// 云仓完成
|
||||||
STATUS_FONT_COMPLETED_CLOUD Order = 8
|
STATUS_FONT_COMPLETED_CLOUD Order = 8
|
||||||
)
|
)
|
||||||
|
|
||||||
|
type Day int64
|
||||||
|
|
||||||
|
// 订单取消时间
|
||||||
|
const (
|
||||||
|
CANCLE_ORDER_EXPIRE Day = 48 * 3600
|
||||||
|
)
|
||||||
|
|
||||||
|
// 订单时间配置
|
||||||
|
const (
|
||||||
|
ORDER_PRODUCT_DAY Day = 25 //产品制作周期(天)
|
||||||
|
ORDER_FACTORY_DELIVER_DAY Day = 2 //厂家发货到货代周期(天)
|
||||||
|
ORDER_DELIVER_UPS_DAY Day = 35 //货代发货至UPS周期(天)
|
||||||
|
ORDER_UPS_TRANS_DAY Day = 5 //UPS运输周期(天)
|
||||||
|
)
|
||||||
|
|
||||||
|
const (
|
||||||
|
LOGISTICS_STATUS_DRAW Order = 1
|
||||||
|
LOGISTICS_STATUS_SHIPPING Order = 2
|
||||||
|
LOGISTICS_STATUS_UPS Order = 3
|
||||||
|
LOGISTICS_STATUS_UPS_ARRIVAL Order = 4
|
||||||
|
LOGISTICS_STATUS_ARRIVAL Order = 5
|
||||||
|
)
|
||||||
|
13
constants/paging.go
Normal file
13
constants/paging.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
// 分页默认当前页
|
||||||
|
const DEFAULT_PAGE = 1
|
||||||
|
|
||||||
|
// 默认每页数量
|
||||||
|
const DEFAULT_PAGE_SIZE = 20
|
||||||
|
|
||||||
|
// 最大每页显示数量
|
||||||
|
const MAX_PAGE_SIZE = 300
|
||||||
|
|
||||||
|
// 最大分页
|
||||||
|
const MAX_PAGE = 100
|
9
constants/recommend_product.go
Normal file
9
constants/recommend_product.go
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
type recommend_product int64
|
||||||
|
|
||||||
|
// 产品详情页推荐产品
|
||||||
|
const PRODUCT_DETAIL_RECOMMEND_CATEGORY recommend_product = 1
|
||||||
|
|
||||||
|
// 主页推荐产品
|
||||||
|
const HOME_PAGE_RECOMMEND_CATEGORY recommend_product = 2
|
28
constants/webset.go
Normal file
28
constants/webset.go
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
type TypeWebSet string
|
||||||
|
|
||||||
|
const (
|
||||||
|
FONT_CONFIG TypeWebSet = "font_config" //字体
|
||||||
|
POLICY_CONFIG TypeWebSet = "policy" //政策
|
||||||
|
CLAUSE_CONFIG TypeWebSet = "clause" //条款
|
||||||
|
FAQ_CONFIG TypeWebSet = "faq" //问答
|
||||||
|
|
||||||
|
RECOMMEND_DETAIL_PRODUCT TypeWebSet = "recommend_detail_" //详情页推荐-后街pid
|
||||||
|
RENDER_DESIGN TypeWebSet = "render_design_" //云渲染 后接client_no
|
||||||
|
LAST_DESIGN TypeWebSet = "last_design_" //最后设计 后接uid
|
||||||
|
OTHER_LIST TypeWebSet = "other_list_" //列表页其他列表 后接type 分类id
|
||||||
|
PRODUCT_INFO TypeWebSet = "product_info_" //详情数据 后接sn
|
||||||
|
MODEL_DATA TypeWebSet = "model_data" //所有模型数据
|
||||||
|
TEMPLATE_PRODUCT TypeWebSet = "product_template_" //模板数据 后接产品id
|
||||||
|
CART_NUM TypeWebSet = "cart_num_" //购物车数量 后接uid
|
||||||
|
USER_ORDERNO TypeWebSet = "order_no_" //用户最新订单编号
|
||||||
|
|
||||||
|
WEBSET_TIME_INFO TypeWebSet = "time_info" //配置时间
|
||||||
|
|
||||||
|
WEBSET_TIME_INFO_PRODUCT_DAY TypeWebSet = "product_day" //配置时间--产品制作周期(天)
|
||||||
|
WEBSET_TIME_INFO_FACTORY_DELIVER_DAY TypeWebSet = "factory_deliver_day" //配置时间--厂家发货到货代周期(天)
|
||||||
|
WEBSET_TIME_INFO_DELIVER_UPS_DAY TypeWebSet = "deliver_ups_day" //配置时间--货代发货至UPS周期(天)
|
||||||
|
WEBSET_TIME_INFO_UPS_TRANS_DAY TypeWebSet = "ups_trans_day" //配置时间--UPS运输周期(天)
|
||||||
|
|
||||||
|
)
|
18
constants/websocket.go
Normal file
18
constants/websocket.go
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
package constants
|
||||||
|
|
||||||
|
type websocket string
|
||||||
|
|
||||||
|
// websocket消息类型
|
||||||
|
const (
|
||||||
|
//鉴权失败
|
||||||
|
WEBSOCKET_UNAUTH = "unAuth"
|
||||||
|
//ws连接成功
|
||||||
|
WEBSOCKET_CONNECT_SUCCESS = "connect-success"
|
||||||
|
//心跳信息
|
||||||
|
WEBSOCKET_HEARTBEAT = "heartbeat"
|
||||||
|
//图片渲染
|
||||||
|
WEBSOCKET_RENDER_IMAGE = "render-image"
|
||||||
|
)
|
||||||
|
|
||||||
|
// 云渲染通知需要的签名字符串
|
||||||
|
const RENDER_NOTIFY_SIGN_KEY = "fusen-render-notify-%s-%d"
|
@ -1,6 +1,36 @@
|
|||||||
#! /bin/bash
|
#!/bin/bash
|
||||||
name=${1%\/}
|
name=${1%%\\*}
|
||||||
|
|
||||||
|
excluded_names=("backend" "product-template" "product-model" "basic")
|
||||||
|
|
||||||
|
for excluded_name in "${excluded_names[@]}"; do
|
||||||
|
if [ "$name" = "$excluded_name" ]; then
|
||||||
|
echo "不能在$name里使用"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
echo $name
|
echo $name
|
||||||
goctl api go -api server_api/$name.api -dir server/$name --home ./goctl_template/
|
goctl api go -api server_api/$name.api -dir server/$name --home ./goctl_template/
|
||||||
# ctxName=server/$name/internal/svc/servicecontext.go
|
|
||||||
# gofmt -w $ctxName
|
# # List of API filenames without the '.api' extension
|
||||||
|
# api_names=("backend" "canteen" "home-user-auth" "map-library" "product" "product-template" "shopping-cart-confirmation" "webset" "data-transfer" "inventory" "orders" "product-model" "render" "upload" "assistant")
|
||||||
|
|
||||||
|
# # Iterate over API filenames and generate Go code, excluding certain names
|
||||||
|
# for api_name in "${api_names[@]}"; do
|
||||||
|
# skip=false
|
||||||
|
|
||||||
|
# for excluded_name in "${excluded_names[@]}"; do
|
||||||
|
# if [ "$api_name" = "$excluded_name" ]; then
|
||||||
|
# skip=true
|
||||||
|
# break
|
||||||
|
# fi
|
||||||
|
# done
|
||||||
|
|
||||||
|
# if [ "$skip" = true ]; then
|
||||||
|
# continue
|
||||||
|
# fi
|
||||||
|
|
||||||
|
# echo "Generating Go code for $api_name"
|
||||||
|
# goctl api go -api server_api/"$api_name".api -dir server/"$api_name" --home ./goctl_template/
|
||||||
|
# done
|
14
fs_gen_api_backend.sh
Executable file
14
fs_gen_api_backend.sh
Executable file
@ -0,0 +1,14 @@
|
|||||||
|
#! /bin/bash
|
||||||
|
name=${1%%\\*}
|
||||||
|
options=("backend" "product-template" "product-model")
|
||||||
|
for option in "${options[@]}"; do
|
||||||
|
if [ "$name" = "$option" ]; then
|
||||||
|
echo $name
|
||||||
|
goctl api go -api server_api/$name.api -dir server/$name --home ./goctl_template_backend/
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
for option in "${options[@]}"; do
|
||||||
|
echo "只支持 $option"
|
||||||
|
done
|
@ -1,4 +1,9 @@
|
|||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
# goctl model mysql ddl --src ./ddl/$1.sql --dir model/ --home ./goctl_template
|
# goctl model mysql ddl --src ./ddl/$1.sql --dir model/ --home ./goctl_template
|
||||||
|
if [ $# -gt 0 ]
|
||||||
go run generator/main.go -name $1
|
then
|
||||||
|
name=${1%%\\*}
|
||||||
|
go run generator/main.go -name $name
|
||||||
|
else
|
||||||
|
echo "输入: - 表示所有表. 或者 单表名"
|
||||||
|
fi
|
||||||
|
@ -342,11 +342,12 @@ func GenFromPath(mdir string, cols []Column, tableName string, tableComment stri
|
|||||||
|
|
||||||
fcontent += importstr + ")\n"
|
fcontent += importstr + ")\n"
|
||||||
fcontent += fmt.Sprintf(structstr, tableName, tableComment, pTableName, fieldstr)
|
fcontent += fmt.Sprintf(structstr, tableName, tableComment, pTableName, fieldstr)
|
||||||
modelstr := fmt.Sprintf(`type %sModel struct {db *gorm.DB}`, pTableName)
|
modelstr := fmt.Sprintf(`type %sModel struct {db *gorm.DB
|
||||||
|
name string}`, pTableName)
|
||||||
fcontent += modelstr
|
fcontent += modelstr
|
||||||
fcontent += "\n"
|
fcontent += "\n"
|
||||||
|
|
||||||
newfuncstr := fmt.Sprintf(`func New%sModel(db *gorm.DB) *%sModel {return &%sModel{db}}`, pTableName, pTableName, pTableName)
|
newfuncstr := fmt.Sprintf(`func New%sModel(db *gorm.DB) *%sModel {return &%sModel{db:db,name:"%s"}}`, pTableName, pTableName, pTableName, tableName)
|
||||||
fcontent += newfuncstr
|
fcontent += newfuncstr
|
||||||
fcontent += "\n"
|
fcontent += "\n"
|
||||||
|
|
||||||
|
44
go.mod
44
go.mod
@ -4,23 +4,35 @@ go 1.20
|
|||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0
|
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0
|
||||||
|
github.com/aws/aws-sdk-go v1.44.295
|
||||||
|
github.com/bwmarrin/snowflake v0.3.0
|
||||||
github.com/golang-jwt/jwt v3.2.2+incompatible
|
github.com/golang-jwt/jwt v3.2.2+incompatible
|
||||||
|
github.com/google/uuid v1.3.0
|
||||||
|
github.com/gorilla/websocket v1.5.0
|
||||||
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
github.com/nfnt/resize v0.0.0-20180221191011-83c6a9932646
|
||||||
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
github.com/skip2/go-qrcode v0.0.0-20200617195104-da1b6568686e
|
||||||
github.com/zeromicro/go-zero v1.5.2
|
github.com/stripe/stripe-go/v74 v74.26.0
|
||||||
|
github.com/zeromicro/go-zero v1.5.4
|
||||||
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
golang.org/x/image v0.0.0-20190802002840-cff245a6509b
|
||||||
|
golang.org/x/oauth2 v0.10.0
|
||||||
gorm.io/driver/mysql v1.5.1
|
gorm.io/driver/mysql v1.5.1
|
||||||
gorm.io/gorm v1.25.1
|
gorm.io/gorm v1.25.1
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/google/uuid v1.3.0 // indirect
|
cloud.google.com/go/compute v1.20.1 // indirect
|
||||||
|
cloud.google.com/go/compute/metadata v0.2.3 // indirect
|
||||||
|
github.com/andybalholm/brotli v1.0.5 // indirect
|
||||||
|
github.com/jmespath/go-jmespath v0.4.0 // indirect
|
||||||
github.com/schollz/progressbar v1.0.0 // indirect
|
github.com/schollz/progressbar v1.0.0 // indirect
|
||||||
github.com/stripe/stripe-go/v74 v74.22.0 // indirect
|
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 // indirect
|
||||||
|
google.golang.org/appengine v1.6.7 // indirect
|
||||||
|
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||||
)
|
)
|
||||||
|
|
||||||
require (
|
require (
|
||||||
github.com/474420502/requests v1.33.0
|
github.com/474420502/requests v1.40.0
|
||||||
github.com/jinzhu/inflection v1.0.0 // indirect
|
github.com/jinzhu/inflection v1.0.0 // indirect
|
||||||
github.com/jinzhu/now v1.1.5 // indirect
|
github.com/jinzhu/now v1.1.5 // indirect
|
||||||
github.com/tidwall/gjson v1.12.0
|
github.com/tidwall/gjson v1.12.0
|
||||||
@ -34,24 +46,22 @@ require (
|
|||||||
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
github.com/cespare/xxhash/v2 v2.2.0 // indirect
|
||||||
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
github.com/dgryski/go-rendezvous v0.0.0-20200823014737-9f7001d12a5f // indirect
|
||||||
github.com/fatih/color v1.15.0 // indirect
|
github.com/fatih/color v1.15.0 // indirect
|
||||||
github.com/felixge/fgprof v0.9.3 // indirect
|
|
||||||
github.com/go-logr/logr v1.2.3 // indirect
|
github.com/go-logr/logr v1.2.3 // indirect
|
||||||
github.com/go-logr/stdr v1.2.2 // indirect
|
github.com/go-logr/stdr v1.2.2 // indirect
|
||||||
github.com/go-redis/redis/v8 v8.11.5 // indirect
|
github.com/go-redis/redis/v8 v8.11.5 // indirect
|
||||||
github.com/go-sql-driver/mysql v1.7.0
|
github.com/go-sql-driver/mysql v1.7.1
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
|
github.com/golang-jwt/jwt/v4 v4.5.0 // indirect
|
||||||
github.com/golang/protobuf v1.5.3 // indirect
|
github.com/golang/protobuf v1.5.3 // indirect
|
||||||
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd // indirect
|
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 // indirect
|
||||||
github.com/mattn/go-colorable v0.1.13 // indirect
|
github.com/mattn/go-colorable v0.1.13 // indirect
|
||||||
github.com/mattn/go-isatty v0.0.17 // indirect
|
github.com/mattn/go-isatty v0.0.17 // indirect
|
||||||
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
github.com/matttproud/golang_protobuf_extensions v1.0.4 // indirect
|
||||||
github.com/openzipkin/zipkin-go v0.4.1 // indirect
|
github.com/openzipkin/zipkin-go v0.4.1 // indirect
|
||||||
github.com/pelletier/go-toml/v2 v2.0.7 // indirect
|
github.com/pelletier/go-toml/v2 v2.0.9 // indirect
|
||||||
github.com/prometheus/client_golang v1.15.0 // indirect
|
github.com/prometheus/client_golang v1.16.0 // indirect
|
||||||
github.com/prometheus/client_model v0.3.0 // indirect
|
github.com/prometheus/client_model v0.3.0 // indirect
|
||||||
github.com/prometheus/common v0.42.0 // indirect
|
github.com/prometheus/common v0.42.0 // indirect
|
||||||
github.com/prometheus/procfs v0.9.0 // indirect
|
github.com/prometheus/procfs v0.10.1 // indirect
|
||||||
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
github.com/spaolacci/murmur3 v1.1.0 // indirect
|
||||||
go.opentelemetry.io/otel v1.14.0 // indirect
|
go.opentelemetry.io/otel v1.14.0 // indirect
|
||||||
go.opentelemetry.io/otel/exporters/jaeger v1.14.0 // indirect
|
go.opentelemetry.io/otel/exporters/jaeger v1.14.0 // indirect
|
||||||
@ -64,11 +74,11 @@ require (
|
|||||||
go.opentelemetry.io/otel/trace v1.14.0 // indirect
|
go.opentelemetry.io/otel/trace v1.14.0 // indirect
|
||||||
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
|
go.opentelemetry.io/proto/otlp v0.19.0 // indirect
|
||||||
go.uber.org/automaxprocs v1.5.2 // indirect
|
go.uber.org/automaxprocs v1.5.2 // indirect
|
||||||
golang.org/x/net v0.9.0 // indirect
|
golang.org/x/net v0.12.0
|
||||||
golang.org/x/sys v0.7.0 // indirect
|
golang.org/x/sys v0.10.0 // indirect
|
||||||
golang.org/x/text v0.9.0
|
golang.org/x/text v0.11.0
|
||||||
google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197 // indirect
|
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc // indirect
|
||||||
google.golang.org/grpc v1.54.0 // indirect
|
google.golang.org/grpc v1.56.2 // indirect
|
||||||
google.golang.org/protobuf v1.30.0 // indirect
|
google.golang.org/protobuf v1.31.0 // indirect
|
||||||
gopkg.in/yaml.v2 v2.4.0 // indirect
|
gopkg.in/yaml.v2 v2.4.0
|
||||||
)
|
)
|
||||||
|
109
go.sum
109
go.sum
@ -19,6 +19,10 @@ cloud.google.com/go/bigquery v1.4.0/go.mod h1:S8dzgnTigyfTmLBfrtrhyYhwRxG72rYxvf
|
|||||||
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
cloud.google.com/go/bigquery v1.5.0/go.mod h1:snEHRnqQbz117VIFhE8bmtwIDY80NLUZUMb4Nv6dBIg=
|
||||||
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
cloud.google.com/go/bigquery v1.7.0/go.mod h1://okPTzCYNXSlb24MZs83e2Do+h+VXtc4gLoIoXIAPc=
|
||||||
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
cloud.google.com/go/bigquery v1.8.0/go.mod h1:J5hqkt3O0uAFnINi6JXValWIb1v0goeZM77hZzJN/fQ=
|
||||||
|
cloud.google.com/go/compute v1.20.1 h1:6aKEtlUiwEpJzM001l0yFkpXmUVXaN8W+fbkb2AZNbg=
|
||||||
|
cloud.google.com/go/compute v1.20.1/go.mod h1:4tCnrn48xsqlwSAiLf1HXMQk8CONslYbdiEZc9FEIbM=
|
||||||
|
cloud.google.com/go/compute/metadata v0.2.3 h1:mg4jlk7mCAj6xXp9UJ4fjI9VUI5rubuGBW5aJ7UnBMY=
|
||||||
|
cloud.google.com/go/compute/metadata v0.2.3/go.mod h1:VAV5nSsACxMJvgaAuX6Pk2AawlZn8kiOGuCv6gTkwuA=
|
||||||
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
cloud.google.com/go/datastore v1.0.0/go.mod h1:LXYbyblFSglQ5pkeyhO+Qmw7ukd3C+pD7TKLgZqpHYE=
|
||||||
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
cloud.google.com/go/datastore v1.1.0/go.mod h1:umbIZjpQpHh4hmRpGhH4tLFup+FVzqBi1b3c64qFpCk=
|
||||||
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
cloud.google.com/go/pubsub v1.0.1/go.mod h1:R0Gpsv3s54REJCy4fxDixWD93lHJMoZTyQ2kNxGRt3I=
|
||||||
@ -32,8 +36,8 @@ cloud.google.com/go/storage v1.8.0/go.mod h1:Wv1Oy7z6Yz3DshWRJFhqM/UCfaWIRTdp0RX
|
|||||||
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
cloud.google.com/go/storage v1.10.0/go.mod h1:FLPqc6j+Ki4BU591ie1oL6qBQGu2Bl/tZ9ullr3+Kg0=
|
||||||
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
dmitri.shuralyov.com/gpu/mtl v0.0.0-20190408044501-666a987793e9/go.mod h1:H6x//7gZCb22OMCxBHrMx7a5I7Hp++hsVxbQ4BYO7hU=
|
||||||
github.com/474420502/random v0.4.1 h1:HUUyLXRWMijVb7CJoEC16f0aFQOW25Lkr80Mut6PoKU=
|
github.com/474420502/random v0.4.1 h1:HUUyLXRWMijVb7CJoEC16f0aFQOW25Lkr80Mut6PoKU=
|
||||||
github.com/474420502/requests v1.33.0 h1:psSTM9WsIDjbjJIXXXhhT52BlpcaNs+gDetQi2wgu1o=
|
github.com/474420502/requests v1.40.0 h1:VDuLxSG/3IGBvMfjPV8+o7s1l5mOwLAgfo5Og6vMAJw=
|
||||||
github.com/474420502/requests v1.33.0/go.mod h1:5qAlksMg7JIrEXrpkxw1++4Z5W2tUkZbHA6M7oq1r/0=
|
github.com/474420502/requests v1.40.0/go.mod h1:2SCVzim0ONFYG09g/GrM7RTeJIC6qTyZfnohsjnG5C8=
|
||||||
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
github.com/BurntSushi/toml v0.3.1/go.mod h1:xHWCNGjB5oqiDr8zfno3MHue2Ht5sIBksp03qcyfWMU=
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
|
github.com/DATA-DOG/go-sqlmock v1.5.0 h1:Shsta01QNfFxHCfpW6YH2STWB0MudeXXEWMr20OEh60=
|
||||||
@ -41,10 +45,16 @@ github.com/OneOfOne/xxhash v1.2.2/go.mod h1:HSdplMjZKSmBqAxg5vPj2TmRDmfkzw+cTzAE
|
|||||||
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0 h1:DNrExYwvyyI404SxdUCCANAj9TwnGjRfa3cYFMNY1AU=
|
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0 h1:DNrExYwvyyI404SxdUCCANAj9TwnGjRfa3cYFMNY1AU=
|
||||||
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0/go.mod h1:SQq4xfIdvf6WYKSDxAJc+xOJdolt+/bc1jnQKMtPMvQ=
|
github.com/SebastiaanKlippert/go-wkhtmltopdf v1.9.0/go.mod h1:SQq4xfIdvf6WYKSDxAJc+xOJdolt+/bc1jnQKMtPMvQ=
|
||||||
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk=
|
github.com/alicebob/gopher-json v0.0.0-20200520072559-a9ecdc9d1d3a h1:HbKu58rmZpUGpz5+4FfNmIU+FmZg2P3Xaj2v2bfNWmk=
|
||||||
github.com/alicebob/miniredis/v2 v2.30.2 h1:lc1UAUT9ZA7h4srlfBmBt2aorm5Yftk9nBjxz7EyY9I=
|
github.com/alicebob/miniredis/v2 v2.30.4 h1:8S4/o1/KoUArAGbGwPxcwf0krlzceva2XVOSchFS7Eo=
|
||||||
|
github.com/andybalholm/brotli v1.0.5 h1:8uQZIdzKmjc/iuPu7O2ioW48L81FgatrcpfFmiq/cCs=
|
||||||
|
github.com/andybalholm/brotli v1.0.5/go.mod h1:fO7iG3H7G2nSZ7m0zPUDn85XEX2GTukHGRSepvi9Eig=
|
||||||
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
github.com/antihax/optional v1.0.0/go.mod h1:uupD/76wgC+ih3iEmQUL+0Ugr19nfwCT1kdvxnR2qWY=
|
||||||
|
github.com/aws/aws-sdk-go v1.44.295 h1:SGjU1+MqttXfRiWHD6WU0DRhaanJgAFY+xIhEaugV8Y=
|
||||||
|
github.com/aws/aws-sdk-go v1.44.295/go.mod h1:aVsgQcEevwlmQ7qHE9I3h+dtQgpqhFB+i8Phjh7fkwI=
|
||||||
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
github.com/beorn7/perks v1.0.1 h1:VlbKKnNfV8bJzeqoa4cOKqO6bYr3WgKZxO8Z16+hsOM=
|
||||||
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
github.com/beorn7/perks v1.0.1/go.mod h1:G2ZrVWU2WbWT9wwq4/hrbKbnv/1ERSJQ0ibhJ6rlkpw=
|
||||||
|
github.com/bwmarrin/snowflake v0.3.0 h1:xm67bEhkKh6ij1790JB83OujPR5CzNe8QuQqAgISZN0=
|
||||||
|
github.com/bwmarrin/snowflake v0.3.0/go.mod h1:NdZxfVWX+oR6y2K0o6qAYv6gIOP9rjG0/E9WsDpxqwE=
|
||||||
github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4=
|
github.com/cenkalti/backoff/v4 v4.2.0 h1:HN5dHm3WBOgndBH6E8V0q2jIYIR3s9yglV8k/+MN3u4=
|
||||||
github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
github.com/cenkalti/backoff/v4 v4.2.0/go.mod h1:Y3VNntkOUPxTVeUxJ/G5vcM//AlwfmyYozVcomhLiZE=
|
||||||
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
github.com/census-instrumentation/opencensus-proto v0.2.1/go.mod h1:f6KPmirojxKA12rnyqOA5BBL4O983OfeGPqjHWSTneU=
|
||||||
@ -78,8 +88,6 @@ github.com/envoyproxy/go-control-plane v0.9.10-0.20210907150352-cf90f659a021/go.
|
|||||||
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
github.com/envoyproxy/protoc-gen-validate v0.1.0/go.mod h1:iSmxcyjqTsJpI2R4NaDN7+kN2VEUnK/pcBlmesArF7c=
|
||||||
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
|
github.com/fatih/color v1.15.0 h1:kOqh6YHBtK8aywxGerMG2Eq3H6Qgoqeo13Bk2Mv/nBs=
|
||||||
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
|
github.com/fatih/color v1.15.0/go.mod h1:0h5ZqXfHYED7Bhv2ZJamyIOUej9KtShiJESRwBDUSsw=
|
||||||
github.com/felixge/fgprof v0.9.3 h1:VvyZxILNuCiUCSXtPtYmmtGvb65nqXh2QFWc0Wpf2/g=
|
|
||||||
github.com/felixge/fgprof v0.9.3/go.mod h1:RdbpDgzqYVh/T9fPELJyV7EYJuHB55UTEULNun8eiPw=
|
|
||||||
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
github.com/fsnotify/fsnotify v1.4.9 h1:hsms1Qyu0jgnwNXIxa+/V/PDsU6CfLf6CNO8H7IWoS4=
|
||||||
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
github.com/ghodss/yaml v1.0.0/go.mod h1:4dBDuWmgqj2HViK6kFavaiC9ZROes6MMH2rRYeMEF04=
|
||||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
@ -92,15 +100,16 @@ github.com/go-logr/stdr v1.2.2 h1:hSWxHoqTgW2S2qGc0LTAI563KZ5YKYRhT3MFKZMbjag=
|
|||||||
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
github.com/go-logr/stdr v1.2.2/go.mod h1:mMo/vtBO5dYbehREoey6XUKy/eSumjCCveDpRre4VKE=
|
||||||
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
|
github.com/go-redis/redis/v8 v8.11.5 h1:AcZZR7igkdvfVmQTPnu9WE37LRrO/YrBH5zWyjDC0oI=
|
||||||
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
|
github.com/go-redis/redis/v8 v8.11.5/go.mod h1:gREzHqY1hg6oD9ngVRbLStwAWKhA0FEgq8Jd4h5lpwo=
|
||||||
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-sql-driver/mysql v1.7.0/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||||
|
github.com/go-sql-driver/mysql v1.7.1 h1:lUIinVbN1DY0xBg0eMOzmmtGoHwWBbvnWubQUrtU8EI=
|
||||||
|
github.com/go-sql-driver/mysql v1.7.1/go.mod h1:OXbVy3sEdcQ2Doequ6Z5BW6fXNQTmx+9S1MCJN5yJMI=
|
||||||
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
|
github.com/golang-jwt/jwt v3.2.2+incompatible h1:IfV12K8xAKAnZqdXVzCZ+TOjboZ2keLg81eXfW3O+oY=
|
||||||
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
github.com/golang-jwt/jwt v3.2.2+incompatible/go.mod h1:8pz2t5EyA70fFQQSrl6XZXzqecmYZeUEB8OUGHkxJ+I=
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
|
github.com/golang-jwt/jwt/v4 v4.5.0 h1:7cYmW1XlMY7h7ii7UhUyChSgS5wUJEnm9uZVTGqOWzg=
|
||||||
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
github.com/golang-jwt/jwt/v4 v4.5.0/go.mod h1:m21LjoU+eqJr34lmDMbreY2eSTRJ1cv77w39/MY0Ch0=
|
||||||
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
github.com/golang/glog v0.0.0-20160126235308-23def4e6c14b/go.mod h1:SBH7ygxi8pfUlaOkMMuAQtPIUF8ecWP5IEl/CR7VP2Q=
|
||||||
github.com/golang/glog v1.0.0 h1:nfP3RFugxnNRyKgeWd4oI1nYvXpxrx8ck8ZrcizshdQ=
|
|
||||||
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
|
github.com/golang/glog v1.0.0/go.mod h1:EWib/APOK0SL3dFbYqvxE3UYd8E6s1ouQ7iEp/0LWV4=
|
||||||
|
github.com/golang/glog v1.1.0 h1:/d3pCKDPWNnvIWe0vVUpNP32qc8U3PDVxySP/y360qE=
|
||||||
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20190702054246-869f871628b6/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20191227052852-215e87163ea7/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
github.com/golang/groupcache v0.0.0-20200121045136-8c9f03a8e57e/go.mod h1:cIg4eruTrX1D+g88fzRXU5OdNfaM+9IcxsU14FzY7Hc=
|
||||||
@ -150,14 +159,14 @@ github.com/google/pprof v0.0.0-20200212024743-f11f1df84d12/go.mod h1:ZgVRPoUq/hf
|
|||||||
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
github.com/google/pprof v0.0.0-20200229191704-1ebb73c60ed3/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
github.com/google/pprof v0.0.0-20200430221834-fc25d7d30c6d/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
github.com/google/pprof v0.0.0-20200708004538-1a94d8640e99/go.mod h1:ZgVRPoUq/hfqzAqh7sHMqb3I9Rq5C59dIz2SbBwJ4eM=
|
||||||
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd h1:1FjCyPC+syAzJ5/2S8fqdZK1R22vvA0J7JZKcuOIQ7Y=
|
|
||||||
github.com/google/pprof v0.0.0-20211214055906-6f57359322fd/go.mod h1:KgnwoLYCZ8IQu3XUZ8Nc/bM9CCZFOyjUNOSygVozoDg=
|
|
||||||
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
github.com/google/renameio v0.1.0/go.mod h1:KWCgfxg9yswjAJkECMjeO8J8rahYeXnNhOm40UhjYkI=
|
||||||
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
github.com/google/uuid v1.1.2/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
|
||||||
github.com/google/uuid v1.3.0 h1:t6JiXgmwXMjEs8VusXIJk2BXHsn+wx8BZdTaoZ5fu7I=
|
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/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/googleapis/gax-go/v2 v2.0.4/go.mod h1:0Wqv26UfaUD9n4G6kQubkQ+KchISgw+vpHVxEJEs9eg=
|
||||||
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
github.com/googleapis/gax-go/v2 v2.0.5/go.mod h1:DWXyrwAJ9X0FpwwEdw+IPEYBICEFu5mhpdKc/us6bOk=
|
||||||
|
github.com/gorilla/websocket v1.5.0 h1:PPwGk2jz7EePpoHN/+ClbZu8SPxiqlu12wZP/3sWmnc=
|
||||||
|
github.com/gorilla/websocket v1.5.0/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE=
|
||||||
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
github.com/grpc-ecosystem/grpc-gateway v1.16.0/go.mod h1:BDjrQk3hbvj6Nolgz8mAMFbcEtjT1g+wF4CSlocrBnw=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.7.0/go.mod h1:hgWBS7lorOAVIJEQMi4ZsPv9hVvWI6+ch50m39Pf2Ks=
|
||||||
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A=
|
github.com/grpc-ecosystem/grpc-gateway/v2 v2.15.0 h1:1JYBfzqrWPcCclBwxFCPAou9n+q86mfnu7NAeHfte7A=
|
||||||
@ -166,11 +175,14 @@ github.com/h2non/parth v0.0.0-20190131123155-b4df798d6542 h1:2VTzZjLZBgl62/EtslC
|
|||||||
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
github.com/hashicorp/golang-lru v0.5.0/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
github.com/hashicorp/golang-lru v0.5.1/go.mod h1:/m3WP610KZHVQ1SGc6re/UDhFvYD7pJ4Ao+sR/qLZy8=
|
||||||
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
github.com/ianlancetaylor/demangle v0.0.0-20181102032728-5e5cf60278f6/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
|
||||||
github.com/ianlancetaylor/demangle v0.0.0-20210905161508-09a460cdf81d/go.mod h1:aYm2/VgdVmcIU8iMfdMvDMsRAQjcfZSKFby6HOFvi/w=
|
|
||||||
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
github.com/jinzhu/inflection v1.0.0 h1:K317FqzuhWc8YvSVlFMCCUb36O/S9MCKRDI7QkRKD/E=
|
||||||
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
github.com/jinzhu/inflection v1.0.0/go.mod h1:h+uFLlag+Qp1Va5pdKtLDYj+kHp5pxUVkryuEj+Srlc=
|
||||||
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
github.com/jinzhu/now v1.1.5 h1:/o9tlHleP7gOFmsnYNz3RGnqzefHA47wQpKrrdTIwXQ=
|
||||||
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
github.com/jinzhu/now v1.1.5/go.mod h1:d3SSVoowX0Lcu0IBviAWJpolVfI5UJVZZ7cO71lE/z8=
|
||||||
|
github.com/jmespath/go-jmespath v0.4.0 h1:BEgLn5cpjn8UN1mAw4NjwDrS35OdebyEtFe+9YPoQUg=
|
||||||
|
github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo=
|
||||||
|
github.com/jmespath/go-jmespath/internal/testify v1.5.1 h1:shLQSRRSCCPj3f2gpwzGwWFoC7ycTf1rcQZHOlsJ6N8=
|
||||||
|
github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U=
|
||||||
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
github.com/jstemmer/go-junit-report v0.0.0-20190106144839-af01ea7f8024/go.mod h1:6v2b51hI/fHJwM22ozAgKL4VKDeJcHhJFhtBdhmNjmU=
|
||||||
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
github.com/jstemmer/go-junit-report v0.9.1/go.mod h1:Brl9GWCQeLvo8nXZwPNNblvFj/XSXhF0NWZEnDohbsk=
|
||||||
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
|
||||||
@ -194,20 +206,21 @@ github.com/onsi/ginkgo v1.16.5 h1:8xi0RTUf59SOSfEtZMvwTvXYMzG4gV23XVHOZiXNtnE=
|
|||||||
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
|
github.com/onsi/gomega v1.18.1 h1:M1GfJqGRrBrrGGsbxzV5dqM2U2ApXefZCQpkukxYRLE=
|
||||||
github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfPcEO5A=
|
github.com/openzipkin/zipkin-go v0.4.1 h1:kNd/ST2yLLWhaWrkgchya40TJabe8Hioj9udfPcEO5A=
|
||||||
github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM=
|
github.com/openzipkin/zipkin-go v0.4.1/go.mod h1:qY0VqDSN1pOBN94dBc6w2GJlWLiovAyg7Qt6/I9HecM=
|
||||||
github.com/pelletier/go-toml/v2 v2.0.7 h1:muncTPStnKRos5dpVKULv2FVd4bMOhNePj9CjgDb8Us=
|
github.com/pelletier/go-toml/v2 v2.0.9 h1:uH2qQXheeefCCkuBBSLi7jCiSmj3VRh2+Goq2N7Xxu0=
|
||||||
github.com/pelletier/go-toml/v2 v2.0.7/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek=
|
github.com/pelletier/go-toml/v2 v2.0.9/go.mod h1:tJU2Z3ZkXwnxa4DPO899bsyIoywizdUvyaeZurnPPDc=
|
||||||
|
github.com/pkg/errors v0.9.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 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
|
||||||
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
|
||||||
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
|
github.com/prashantv/gostub v1.1.0 h1:BTyx3RfQjRHnUWaGF9oQos79AlQ5k8WNktv7VGvVH4g=
|
||||||
github.com/prometheus/client_golang v1.15.0 h1:5fCgGYogn0hFdhyhLbw7hEsWxufKtY9klyvdNfFlFhM=
|
github.com/prometheus/client_golang v1.16.0 h1:yk/hx9hDbrGHovbci4BY+pRMfSuuat626eFsHb7tmT8=
|
||||||
github.com/prometheus/client_golang v1.15.0/go.mod h1:e9yaBhRPU2pPNsZwE+JdQl0KEt1N9XgF6zxWmaC0xOk=
|
github.com/prometheus/client_golang v1.16.0/go.mod h1:Zsulrv/L9oM40tJ7T815tM89lFEugiJ9HzIqaAx4LKc=
|
||||||
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
github.com/prometheus/client_model v0.0.0-20190812154241-14fe0d1b01d4/go.mod h1:xMI15A0UPsDsEKsMN9yxemIoYk6Tm2C1GtYGdfGttqA=
|
||||||
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
|
github.com/prometheus/client_model v0.3.0 h1:UBgGFHqYdG/TPFD1B1ogZywDqEkwp3fBMvqdiQ7Xew4=
|
||||||
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
|
github.com/prometheus/client_model v0.3.0/go.mod h1:LDGWKZIo7rky3hgvBe+caln+Dr3dPggB5dvjtD7w9+w=
|
||||||
github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
|
github.com/prometheus/common v0.42.0 h1:EKsfXEYo4JpWMHH5cg+KOUWeuJSov1Id8zGR8eeI1YM=
|
||||||
github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
|
github.com/prometheus/common v0.42.0/go.mod h1:xBwqVerjNdUDjgODMpudtOMwlOwf2SaTr1yjz4b7Zbc=
|
||||||
github.com/prometheus/procfs v0.9.0 h1:wzCHvIvM5SxWqYvwgVL7yJY8Lz3PKn49KQtpgMYJfhI=
|
github.com/prometheus/procfs v0.10.1 h1:kYK1Va/YMlutzCGazswoHKo//tZVlFpKYh+PymziUAg=
|
||||||
github.com/prometheus/procfs v0.9.0/go.mod h1:+pB4zwohETzFnmlpe6yd2lSc+0/46IYZRB/chUwxUZY=
|
github.com/prometheus/procfs v0.10.1/go.mod h1:nwNm2aOCAYw8uTR/9bWRREkZFxAUcWzPHWJq+XBB/FM=
|
||||||
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
github.com/rogpeppe/fastuuid v1.2.0/go.mod h1:jVj6XXZzXRy/MSR5jhDC/2q6DgLz+nrA6LYCDYWNEvQ=
|
||||||
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
github.com/rogpeppe/go-internal v1.3.0/go.mod h1:M8bDsm7K2OlrFYOpmOWEs/qY81heoFRclV5y23lUDJ4=
|
||||||
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
github.com/rogpeppe/go-internal v1.9.0 h1:73kH8U+JUqXU8lRuOHeVHaa/SZPifC7BkcraZVejAe8=
|
||||||
@ -227,10 +240,10 @@ github.com/stretchr/testify v1.5.1/go.mod h1:5W2xD1RspED5o8YsWQXVCued0rvSQ+mT+I5
|
|||||||
github.com/stretchr/testify v1.7.0/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg=
|
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.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.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU=
|
||||||
github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4=
|
github.com/stretchr/testify v1.8.4 h1:CcVxjf3Q8PM0mHUKJCdn+eZZtm5yQwehR5yeSVQQcUk=
|
||||||
github.com/stretchr/testify v1.8.2 h1:+h33VjcLVPDHtOdpUCuF+7gSuG3yGIftsP1YvFihtJ8=
|
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
|
||||||
github.com/stripe/stripe-go/v74 v74.22.0 h1:A6yqbyS61JYWhq6H4b0PFZukM8Ltx1VOXxsLYBNL+wE=
|
github.com/stripe/stripe-go/v74 v74.26.0 h1:enbhLtjKGWvJKcGM0f2CazqFSXzpHXcQ42nG2PNsWK0=
|
||||||
github.com/stripe/stripe-go/v74 v74.22.0/go.mod h1:f9L6LvaXa35ja7eyvP6GQswoaIPaBRvGAimAO+udbBw=
|
github.com/stripe/stripe-go/v74 v74.26.0/go.mod h1:f9L6LvaXa35ja7eyvP6GQswoaIPaBRvGAimAO+udbBw=
|
||||||
github.com/tidwall/gjson v1.12.0 h1:61wEp/qfvFnqKH/WCI3M8HuRut+mHT6Mr82QrFmM2SY=
|
github.com/tidwall/gjson v1.12.0 h1:61wEp/qfvFnqKH/WCI3M8HuRut+mHT6Mr82QrFmM2SY=
|
||||||
github.com/tidwall/gjson v1.12.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
github.com/tidwall/gjson v1.12.0/go.mod h1:/wbyibRr2FHMks5tjHJ5F8dMZh3AcwJEMf5vlfC0lxk=
|
||||||
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
github.com/tidwall/match v1.1.1 h1:+Ho715JplO36QYgwN9PGYNhgZvoUSc9X2c80KVTi+GA=
|
||||||
@ -240,9 +253,10 @@ github.com/tidwall/pretty v1.2.0/go.mod h1:ITEVvHYasfjBbM0u2Pg8T2nJnzm8xPwvNhhso
|
|||||||
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.25/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
github.com/yuin/goldmark v1.1.32/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
|
||||||
|
github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
|
||||||
github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE=
|
github.com/yuin/gopher-lua v1.1.0 h1:BojcDhfyDWgU2f2TOzYK/g5p2gxMrku8oupLDqlnSqE=
|
||||||
github.com/zeromicro/go-zero v1.5.2 h1:vpMlZacCMtgdtYzKI3OMyhS6mZ9UQctiAh0J7gIq31I=
|
github.com/zeromicro/go-zero v1.5.4 h1:kRvcYuxcHOkUZvg7887KQl77Qv4klGL7MqGkTBgkpS8=
|
||||||
github.com/zeromicro/go-zero v1.5.2/go.mod h1:ndCd1nMMAdEMZgPfdm1fpavHUdBW0ykB6ckCRaSG10w=
|
github.com/zeromicro/go-zero v1.5.4/go.mod h1:x/aUyLmSwRECvOyjOf+lhwThBOilJIY+s3slmPAeboA=
|
||||||
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
go.opencensus.io v0.21.0/go.mod h1:mSImk1erAIZhrmZN+AvHh14ztQfjbGwt4TtuofqLduU=
|
||||||
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
go.opencensus.io v0.22.0/go.mod h1:+kGneAE2xo2IficOXnaByMWTGM9T73dGwxeWcUqIpI8=
|
||||||
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
go.opencensus.io v0.22.2/go.mod h1:yxeiOL68Rb0Xd1ddK5vPZ/oVn4vY4Ynel7k9FzqtOIw=
|
||||||
@ -260,6 +274,8 @@ go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0 h1:ap+y8
|
|||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0/go.mod h1:5w41DY6S9gZrbjuq6Y+753e96WfPha5IcsOSZTtullM=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracegrpc v1.14.0/go.mod h1:5w41DY6S9gZrbjuq6Y+753e96WfPha5IcsOSZTtullM=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0 h1:3jAYbRHQAqzLjd9I4tzxwJ8Pk/N6AqBcF6m1ZHrxG94=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0 h1:3jAYbRHQAqzLjd9I4tzxwJ8Pk/N6AqBcF6m1ZHrxG94=
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0/go.mod h1:+N7zNjIJv4K+DeX67XXET0P+eIciESgaFDBqh+ZJFS4=
|
go.opentelemetry.io/otel/exporters/otlp/otlptrace/otlptracehttp v1.14.0/go.mod h1:+N7zNjIJv4K+DeX67XXET0P+eIciESgaFDBqh+ZJFS4=
|
||||||
|
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0 h1:sEL90JjOO/4yhquXl5zTAkLLsZ5+MycAgX99SDsxGc8=
|
||||||
|
go.opentelemetry.io/otel/exporters/stdout/stdouttrace v1.14.0/go.mod h1:oCslUcizYdpKYyS9e8srZEqM6BB8fq41VJBjLAE6z1w=
|
||||||
go.opentelemetry.io/otel/exporters/zipkin v1.14.0 h1:reEVE1upBF9tcujgvSqLJS0SrI7JQPaTKP4s4rymnSs=
|
go.opentelemetry.io/otel/exporters/zipkin v1.14.0 h1:reEVE1upBF9tcujgvSqLJS0SrI7JQPaTKP4s4rymnSs=
|
||||||
go.opentelemetry.io/otel/exporters/zipkin v1.14.0/go.mod h1:RcjvOAcvhzcufQP8aHmzRw1gE9g/VEZufDdo2w+s4sk=
|
go.opentelemetry.io/otel/exporters/zipkin v1.14.0/go.mod h1:RcjvOAcvhzcufQP8aHmzRw1gE9g/VEZufDdo2w+s4sk=
|
||||||
go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
|
go.opentelemetry.io/otel/sdk v1.14.0 h1:PDCppFRDq8A1jL9v6KMI6dYesaq+DFcDZvjsoGvxGzY=
|
||||||
@ -277,6 +293,7 @@ golang.org/x/crypto v0.0.0-20190510104115-cbcb75029529/go.mod h1:yigFU9vqHzYiE8U
|
|||||||
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20190605123033-f99c8df09eb5/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
golang.org/x/crypto v0.0.0-20191011191535-87dc89f01550/go.mod h1:yigFU9vqHzYiE8UmvKecakEJjdnWj3jj499lnFckfCI=
|
||||||
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
golang.org/x/crypto v0.0.0-20200622213623-75b288015ac9/go.mod h1:LzIPMQfyMNhhGPhUkYOs5KpL4U8rLKemX1yGLhDgUto=
|
||||||
|
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
|
||||||
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190121172915-509febef88a4/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
golang.org/x/exp v0.0.0-20190306152737-a1d7652674e8/go.mod h1:CJ0aWSM057203Lf6IL+f9T1iT9GByDxfZKAQTCR3kQA=
|
||||||
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
golang.org/x/exp v0.0.0-20190510132918-efd6b22b2522/go.mod h1:ZjyILWgesfNpC6sMxTJOJm9Kp84zZh5NQWvqDGG3Qr8=
|
||||||
@ -308,6 +325,7 @@ golang.org/x/mod v0.1.1-0.20191105210325-c90efee705ee/go.mod h1:QqPTAvyqsEbceGzB
|
|||||||
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
golang.org/x/mod v0.1.1-0.20191107180719-034126e5016b/go.mod h1:QqPTAvyqsEbceGzBzNggFXnrqF1CaUcvgkdR5Ot7KZg=
|
||||||
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.2.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
golang.org/x/mod v0.3.0/go.mod h1:s0Qsj1ACt9ePp/hMypM3fl4fZqREWJwdYDEqhRiZZUA=
|
||||||
|
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-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-20180826012351-8a410e7b638d/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-20190108225652-1e06a53dbb7e/go.mod h1:mL1N/T3taQHkDXs73rZJwtUhF3w3ftmwwsq0BUmARs4=
|
||||||
@ -334,16 +352,21 @@ golang.org/x/net v0.0.0-20200520182314-0ba52f642ac2/go.mod h1:qpuaurCH72eLCgpAm/
|
|||||||
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
golang.org/x/net v0.0.0-20200625001655-4c5254603344/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
golang.org/x/net v0.0.0-20200707034311-ab3426394381/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
golang.org/x/net v0.0.0-20200822124328-c89045814202/go.mod h1:/O7V0waA8r7cgGh81Ro3o1hOxt32SMVPicZroKQ2sZA=
|
||||||
|
golang.org/x/net v0.0.0-20210226172049-e18ecbb05110/go.mod h1:m0MpNAwzfU5UDzcl9v0D8zg8gWTRqZa9RBIspLL5mdg=
|
||||||
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
golang.org/x/net v0.0.0-20210405180319-a5a99cb37ef4/go.mod h1:p54w0d4576C0XHj96bSt6lcn1PtDYWL6XObtHCRCNQM=
|
||||||
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
golang.org/x/net v0.0.0-20210520170846-37e1c6afe023/go.mod h1:9nx3DQGgdP8bBQD5qxJ1jj9UTztislL4KSBs9R2vV5Y=
|
||||||
golang.org/x/net v0.9.0 h1:aWJ/m6xSmxWBx+V0XRHTlrYrPG56jKsLdTFmsSsCzOM=
|
golang.org/x/net v0.0.0-20220722155237-a158d28d115b/go.mod h1:XRhObCWvk6IyKnWLug+ECip1KBveYUHfp+8e9klMJ9c=
|
||||||
golang.org/x/net v0.9.0/go.mod h1:d48xBJpPfHeWQsugry2m+kC02ZBRGRgulfHnEXEuWns=
|
golang.org/x/net v0.1.0/go.mod h1:Cx3nUiGt4eDBEyega/BKRp+/AlGL8hYe7U9odMt2Cco=
|
||||||
|
golang.org/x/net v0.12.0 h1:cfawfvKITfUsFCeJIHJrbSxpeu/E81khclypR0GVT50=
|
||||||
|
golang.org/x/net v0.12.0/go.mod h1:zEVYFnQC7m/vmpQFELhcD1EWkZlX69l4oqgmer6hfKA=
|
||||||
golang.org/x/oauth2 v0.0.0-20180821212333-d2e6202438be/go.mod h1:N/0e6XlmueqKjAGxoOufVs8QHGRruUQn6yWY3a++T0U=
|
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/oauth2 v0.0.0-20190226205417-e64efc72b421/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20190604053449-0f29369cfe45/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20191202225959-858c2ad4c8b6/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
golang.org/x/oauth2 v0.0.0-20200107190931-bf48bf16ab8d/go.mod h1:gOpvHmFTYa4IltrdGE7lF6nIHvwfUNPOp7c8zoXwtLw=
|
||||||
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
golang.org/x/oauth2 v0.0.0-20211104180415-d3ed0bb246c8/go.mod h1:KelEdhl1UZF7XfJ4dDtk6s++YSgaE7mD/BuKKDLBl4A=
|
||||||
|
golang.org/x/oauth2 v0.10.0 h1:zHCpF2Khkwy4mMB4bv0U37YtJdTGW8jI0glAApi0Kh8=
|
||||||
|
golang.org/x/oauth2 v0.10.0/go.mod h1:kTpgurOux7LqtuxjuyZa4Gj2gdezIt/jQtGnNFfypQI=
|
||||||
golang.org/x/sync v0.0.0-20180314180146-1d60e4601c6f/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
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-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-20181221193216-37e7f081c4d4/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
@ -352,6 +375,7 @@ golang.org/x/sync v0.0.0-20190423024810-112230192c58/go.mod h1:RxMgew5VJxzue5/jJ
|
|||||||
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20190911185100-cd5d95a43a6e/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20200317015054-43a5402ce75a/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
||||||
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/go.mod h1:RxMgew5VJxzue5/jJTE5uejpjVlOe/izrB70Jof72aM=
|
golang.org/x/sync v0.0.0-20200625203802-6e8e738ad208/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-20180830151530-49385e6e1522/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-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
|
||||||
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20190312061237-fead79001313/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
@ -381,11 +405,16 @@ golang.org/x/sys v0.0.0-20201119102817-f84b799fce68/go.mod h1:h1NjWce9XRLGQEsW7w
|
|||||||
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210330210617-4fbd30eecc44/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
golang.org/x/sys v0.0.0-20210423082822-04245dca01da/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
|
||||||
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210510120138-977fb7262007/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.0.0-20211007075335-d3039528d8ac/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.0.0-20210615035016-665e8c7367d1/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.0.0-20220811171246-fbc7d0a398ab/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.7.0 h1:3jlCCIQZPdOYu1h8BkNvLz8Kgwtae2cagcG/VamtZRU=
|
golang.org/x/sys v0.1.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
||||||
golang.org/x/sys v0.7.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
|
golang.org/x/sys v0.10.0 h1:SqMFp9UcQJZa+pmYuAKjd9xq1f0j5rLcDIk0mj4qAsA=
|
||||||
|
golang.org/x/sys v0.10.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-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.1.0/go.mod h1:jbD1KX2456YbFQfuXm/mYQcufACuNUgVhRMnK/tPxf8=
|
||||||
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
golang.org/x/text v0.0.0-20170915032832-14c0d48ead0c/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
golang.org/x/text v0.3.0/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
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.1-0.20180807135948-17ff2d5776d2/go.mod h1:NqM8EUOU14njkJ3fqMW+pc6Ldnwhi/IjpwHt7yyuwOQ=
|
||||||
@ -393,8 +422,10 @@ golang.org/x/text v0.3.2/go.mod h1:bEr9sfX3Q8Zfm5fL9x+3itogRgK3+ptLWKqgva+5dAk=
|
|||||||
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.3/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.5/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
golang.org/x/text v0.3.6/go.mod h1:5Zoc/QRtKVWzQhOtBMvqHzDpF6irO9z98xDceosuGiQ=
|
||||||
golang.org/x/text v0.9.0 h1:2sjJmO8cDvYveuX97RDLsxlyUxLl+GHoLxBiRdHllBE=
|
golang.org/x/text v0.3.7/go.mod h1:u+2+/6zg+i71rQMx5EYifcz6MCKuco9NR6JIITiCfzQ=
|
||||||
golang.org/x/text v0.9.0/go.mod h1:e1OnstbJyHTd6l/uOt8jFFHp6TRDWZR/bV3emEE/zU8=
|
golang.org/x/text v0.4.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8=
|
||||||
|
golang.org/x/text v0.11.0 h1:LAntKIrcmeSKERyiOh0XMV39LXS8IE9UL2yP7+f5ij4=
|
||||||
|
golang.org/x/text v0.11.0/go.mod h1:TvPlkZtksWOMsz7fbANvkp4WM8x/WCo/om8BMLbz+aE=
|
||||||
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20181108054448-85acf8d2951c/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
golang.org/x/time v0.0.0-20191024005414-555d28b269f0/go.mod h1:tRJNPiyCQ0inRvYxbN9jk5I+vvW/OXSQhTDSoE431IQ=
|
||||||
@ -438,6 +469,7 @@ golang.org/x/tools v0.0.0-20200618134242-20370b0cb4b2/go.mod h1:EkVYQZoAsY45+roY
|
|||||||
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
golang.org/x/tools v0.0.0-20200729194436-6467de6f59a7/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
golang.org/x/tools v0.0.0-20200804011535-6c149bb5ef0d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
golang.org/x/tools v0.0.0-20200825202427-b303f430e36d/go.mod h1:njjCfa9FT2d7l9Bc6FUM5FLjQPp3cFF28FI3qnDFljA=
|
||||||
|
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=
|
golang.org/x/xerrors v0.0.0-20190717185122-a985d3407aa7/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191011141410-1b5146add898/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
golang.org/x/xerrors v0.0.0-20191204190536-9bdfabe68543/go.mod h1:I/5z698sn9Ka8TeJc9MKroUUfqBBauWjQqLJ2OPfmY0=
|
||||||
@ -464,6 +496,8 @@ google.golang.org/appengine v1.5.0/go.mod h1:xpcJRLb0r/rnEns0DIKYYv+WjYCduHsrkT7
|
|||||||
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
google.golang.org/appengine v1.6.1/go.mod h1:i06prIuMbXzDqacNJfV5OdTW448YApPu5ww/cMBSeb0=
|
||||||
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
google.golang.org/appengine v1.6.5/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
google.golang.org/appengine v1.6.6/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
|
google.golang.org/appengine v1.6.7 h1:FZR1q0exgwxzPzp/aF+VccGrSfxfPpkBqjIIEq3ru6c=
|
||||||
|
google.golang.org/appengine v1.6.7/go.mod h1:8WjMMxjGQR8xUklV/ARdw2HLXBOI7O7uCIDZVag1xfc=
|
||||||
google.golang.org/genproto v0.0.0-20180817151627-c66870c02cf8/go.mod h1:JiN7NxoALGmiZfu7CAH4rXhgtRTLTxftemlI0sWmxmc=
|
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-20190307195333-5fe7a883aa19/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
google.golang.org/genproto v0.0.0-20190418145605-e7d98fc518a7/go.mod h1:VzzqZJRnGkLBvHegQrXjBqPurQTc5/KpmUdxsrq26oE=
|
||||||
@ -495,8 +529,12 @@ google.golang.org/genproto v0.0.0-20200729003335-053ba62fc06f/go.mod h1:FWY/as6D
|
|||||||
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20200804131852-c06518451d9c/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
google.golang.org/genproto v0.0.0-20200825200019-8632dd797987/go.mod h1:FWY/as6DDZQgahTzZj3fqbO1CbirC29ZNUFHwi0/+no=
|
||||||
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
google.golang.org/genproto v0.0.0-20211118181313-81c1377c94b1/go.mod h1:5CzLGKJ67TSI2B9POpiiyGha0AjJvZIUgRMt1dSmuhc=
|
||||||
google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197 h1:BwjeHhu4HS48EZmu1nS7flldBIDPC3qn+HqaSQ1K4x8=
|
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc h1:8DyZCyvI8mE1IdLy/60bS+52xfymkE72wv1asokgtao=
|
||||||
google.golang.org/genproto v0.0.0-20230123190316-2c411cf9d197/go.mod h1:RGgjbofJ8xD9Sq1VVhDM1Vok1vRONV+rg+CjzG4SZKM=
|
google.golang.org/genproto v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:xZnkP7mREFX5MORlOPEzLMr+90PPZQ2QWzrVTWfAq64=
|
||||||
|
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc h1:kVKPf/IiYSBWEWtkIn6wZXwWGCnLKcC8oWfZvXjsGnM=
|
||||||
|
google.golang.org/genproto/googleapis/api v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:vHYtlOoi6TsQ3Uk2yxR7NI5z8uoV+3pZtR4jmHIkRig=
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc h1:XSJ8Vk1SWuNr8S18z1NZSziL0CPIXLCCMDOEFtHBOFc=
|
||||||
|
google.golang.org/genproto/googleapis/rpc v0.0.0-20230530153820-e85fd2cbaebc/go.mod h1:66JfowdXAEgad5O9NnYcsNPLCPZJD++2L9X0PCMODrA=
|
||||||
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
google.golang.org/grpc v1.19.0/go.mod h1:mqu4LbDTu4XGKhr4mRzUsmM4RtVoemTSY81AxZiDr8c=
|
||||||
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
google.golang.org/grpc v1.20.1/go.mod h1:10oTOabMzJvdu6/UiuZezV6QK5dSlG84ov/aaiqXj38=
|
||||||
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
google.golang.org/grpc v1.21.1/go.mod h1:oYelfM1adQP15Ek0mdvEgi9Df8B9CZIaU1084ijfRaM=
|
||||||
@ -513,8 +551,8 @@ google.golang.org/grpc v1.33.1/go.mod h1:fr5YgcSWrqhRRxogOsw7RzIpsmvOZ6IcH4kBYTp
|
|||||||
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
google.golang.org/grpc v1.36.0/go.mod h1:qjiiYl8FncCW8feJPdyg3v6XW24KsRHe+dy9BAGRRjU=
|
||||||
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
google.golang.org/grpc v1.40.0/go.mod h1:ogyxbiOoUXAkP+4+xa6PZSE9DZgIHtSpzjDTB9KAK34=
|
||||||
google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
|
google.golang.org/grpc v1.42.0/go.mod h1:k+4IHHFw41K8+bbowsex27ge2rCb65oeWqe4jJ590SU=
|
||||||
google.golang.org/grpc v1.54.0 h1:EhTqbhiYeixwWQtAEZAxmV9MGqcjEU2mFx52xCzNyag=
|
google.golang.org/grpc v1.56.2 h1:fVRFRnXvU+x6C4IlHZewvJOVHoOv1TUuQyoRsYnB4bI=
|
||||||
google.golang.org/grpc v1.54.0/go.mod h1:PUSEXI6iWghWaB6lXM4knEgpJNu2qUcKfDtNci3EC2g=
|
google.golang.org/grpc v1.56.2/go.mod h1:I9bI3vqKfayGqPUAwGdOSu7kt6oIJLixfffKrpXqQ9s=
|
||||||
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
google.golang.org/protobuf v0.0.0-20200109180630-ec00e32a8dfd/go.mod h1:DFci5gLYBciE7Vtevhsrf46CRTquxDuWsQurQQe4oz8=
|
||||||
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
google.golang.org/protobuf v0.0.0-20200221191635-4d8936d0db64/go.mod h1:kwYJMbMJ01Woi6D6+Kah6886xMZcty6N08ah7+eCXa0=
|
||||||
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
google.golang.org/protobuf v0.0.0-20200228230310-ab0ca4ff8a60/go.mod h1:cfTl7dwQJ+fmap5saPgwCLgHXTUD7jkjRqWcaiX5VyM=
|
||||||
@ -528,8 +566,8 @@ google.golang.org/protobuf v1.25.0/go.mod h1:9JNX74DMeImyA3h4bdi1ymwjUzf21/xIlba
|
|||||||
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
google.golang.org/protobuf v1.26.0-rc.1/go.mod h1:jlhhOSvTdKEhbULTjvd4ARK9grFBp09yW+WbY/TyQbw=
|
||||||
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.26.0/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
google.golang.org/protobuf v1.27.1/go.mod h1:9q0QmTI4eRPtz6boOQmLYwt+qCgq0jsYwAQnmE0givc=
|
||||||
google.golang.org/protobuf v1.30.0 h1:kPPoIgf3TsEvrm0PFe15JQ+570QVxYzEvvHqChK+cng=
|
google.golang.org/protobuf v1.31.0 h1:g0LDEJHgrBl9N9r17Ru3sqWhkIx2NB67okBHPwC7hs8=
|
||||||
google.golang.org/protobuf v1.30.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
google.golang.org/protobuf v1.31.0/go.mod h1:HV8QOd/L58Z+nl8r43ehVNZIU/HEI6OcFqwMG9pJV4I=
|
||||||
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
gopkg.in/check.v1 v1.0.0-20180628173108-788fd7840127/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0=
|
||||||
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
gopkg.in/check.v1 v1.0.0-20201130134442-10cb98267c6c h1:Hei/4ADfdWqJk1ZMxUNpqntNwaWcugrBjAiHlqqRiVk=
|
||||||
@ -538,6 +576,7 @@ gopkg.in/h2non/gock.v1 v1.1.2 h1:jBbHXgGBK/AoPVfJh5x4r/WxIrElvbLel8TCZkkZJoY=
|
|||||||
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
gopkg.in/tomb.v1 v1.0.0-20141024135613-dd632973f1e7 h1:uRGJdciOHaEIrze2W8Q3AKkepLTh2hOroT7a+7czfdQ=
|
||||||
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.2/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
gopkg.in/yaml.v2 v2.2.3/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
|
gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI=
|
||||||
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY=
|
||||||
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ=
|
||||||
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM=
|
||||||
|
@ -1,7 +1,6 @@
|
|||||||
package config
|
package config
|
||||||
|
|
||||||
import {{.authImport}}
|
import {{.authImport}}
|
||||||
import "fusenapi/server/faq/internal/types"
|
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
rest.RestConf
|
rest.RestConf
|
||||||
|
@ -33,6 +33,12 @@ func NewServiceContext(c {{.config}}) *ServiceContext {
|
|||||||
|
|
||||||
func (svcCtx *ServiceContext) ParseJwtToken(r *http.Request) (jwt.MapClaims, error) {
|
func (svcCtx *ServiceContext) ParseJwtToken(r *http.Request) (jwt.MapClaims, error) {
|
||||||
AuthKey := r.Header.Get("Authorization")
|
AuthKey := r.Header.Get("Authorization")
|
||||||
|
if AuthKey == "" {
|
||||||
|
return nil, nil
|
||||||
|
}
|
||||||
|
AuthKey = AuthKey[7:]
|
||||||
|
|
||||||
|
|
||||||
if len(AuthKey) <= 50 {
|
if len(AuthKey) <= 50 {
|
||||||
return nil, errors.New(fmt.Sprint("Error parsing token, len:", len(AuthKey)))
|
return nil, errors.New(fmt.Sprint("Error parsing token, len:", len(AuthKey)))
|
||||||
}
|
}
|
||||||
|
@ -1,8 +1,8 @@
|
|||||||
Name: {{.serviceName}}
|
Name: {{.serviceName}}
|
||||||
Host: {{.host}}
|
Host: {{.host}}
|
||||||
Port: {{.port}}
|
Port: {{.port}}
|
||||||
SourceMysql: ""
|
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||||
Auth:
|
Auth:
|
||||||
AccessSecret: fusen2023
|
AccessSecret: fusen2023
|
||||||
AccessExpire: 604800
|
AccessExpire: 2592000
|
||||||
RefreshAfter: 345600
|
RefreshAfter: 1592000
|
@ -2,12 +2,8 @@ package {{.PkgName}}
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
"errors"
|
"reflect"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
|
||||||
|
|
||||||
"fusenapi/utils/auth"
|
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
{{.ImportPackages}}
|
{{.ImportPackages}}
|
||||||
@ -16,61 +12,22 @@ import (
|
|||||||
func {{.HandlerName}}(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func {{.HandlerName}}(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
return func(w http.ResponseWriter, r *http.Request) {
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
|
||||||
var (
|
|
||||||
// 定义错误变量
|
|
||||||
err error
|
|
||||||
// 定义用户信息变量
|
|
||||||
userinfo *auth.UserInfo
|
|
||||||
)
|
|
||||||
// 解析JWT token,并对空用户进行判断
|
|
||||||
claims, err := svcCtx.ParseJwtToken(r)
|
|
||||||
// 如果解析JWT token出错,则返回未授权的JSON响应并记录错误消息
|
|
||||||
if err != nil {
|
|
||||||
httpx.OkJsonCtx(r.Context(), w, &basic.Response{
|
|
||||||
Code: 401, // 返回401状态码,表示未授权
|
|
||||||
Message: "unauthorized", // 返回未授权信息
|
|
||||||
})
|
|
||||||
logx.Info("unauthorized:", err.Error()) // 记录错误日志
|
|
||||||
return
|
|
||||||
}
|
|
||||||
|
|
||||||
if claims != nil {
|
|
||||||
// 从token中获取对应的用户信息
|
|
||||||
userinfo, err = auth.GetUserInfoFormMapClaims(claims)
|
|
||||||
// 如果获取用户信息出错,则返回未授权的JSON响应并记录错误消息
|
|
||||||
if err != nil {
|
|
||||||
httpx.OkJsonCtx(r.Context(), w, &basic.Response{
|
|
||||||
Code: 401,
|
|
||||||
Message: "unauthorized",
|
|
||||||
})
|
|
||||||
logx.Info("unauthorized:", err.Error())
|
|
||||||
return
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
// 如果claims为nil,则认为用户身份为白板用户
|
|
||||||
userinfo = &auth.UserInfo{UserId: 0, GuestId: 0}
|
|
||||||
}
|
|
||||||
|
|
||||||
{{if .HasRequest}}var req types.{{.RequestType}}
|
{{if .HasRequest}}var req types.{{.RequestType}}
|
||||||
// 如果端点有请求结构体,则使用httpx.Parse方法从HTTP请求体中解析请求数据
|
userinfo, err := basic.RequestParse(w, r, svcCtx, &req)
|
||||||
if err := httpx.Parse(r, &req); err != nil {
|
if err != nil {
|
||||||
httpx.OkJsonCtx(r.Context(), w, &basic.Response{
|
|
||||||
Code: 510,
|
|
||||||
Message: "parameter error",
|
|
||||||
})
|
|
||||||
logx.Info(err)
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
// 创建一个业务逻辑层实例
|
// 创建一个业务逻辑层实例
|
||||||
{{end}}l := {{.LogicName}}.New{{.LogicType}}(r.Context(), svcCtx)
|
{{end}}l := {{.LogicName}}.New{{.LogicType}}(r.Context(), svcCtx)
|
||||||
|
|
||||||
|
rl := reflect.ValueOf(l)
|
||||||
|
basic.BeforeLogic(w, r, rl)
|
||||||
|
|
||||||
{{if .HasResp}}resp{{end}} := l.{{.Call}}({{if .HasRequest}}&req, {{end}}userinfo)
|
{{if .HasResp}}resp{{end}} := l.{{.Call}}({{if .HasRequest}}&req, {{end}}userinfo)
|
||||||
// 如果响应不为nil,则使用httpx.OkJsonCtx方法返回JSON响应;
|
|
||||||
if resp != nil {
|
if !basic.AfterLogic(w, r, rl, resp) {
|
||||||
{{if .HasResp}}httpx.OkJsonCtx(r.Context(), w, resp){{else}}httpx.Ok(w){{end}}
|
basic.NormalAfterLogic(w, r, resp)
|
||||||
} else {
|
|
||||||
err := errors.New("server logic is error, resp must not be nil")
|
|
||||||
httpx.ErrorCtx(r.Context(), w, err)
|
|
||||||
logx.Error(err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -21,6 +21,15 @@ func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) *{{.logic}}
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// 处理进入前逻辑w,r
|
||||||
|
// func (l *{{.logic}}) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *{{.logic}}) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
|
|
||||||
func (l *{{.logic}}) {{.function}}({{.request}}, userinfo *auth.UserInfo) (resp *basic.Response) {
|
func (l *{{.logic}}) {{.function}}({{.request}}, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
// userinfo 传入值时, 一定不为null
|
// userinfo 传入值时, 一定不为null
|
||||||
|
@ -3,6 +3,10 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
|
||||||
{{.importPackages}}
|
{{.importPackages}}
|
||||||
)
|
)
|
||||||
@ -13,9 +17,10 @@ func main() {
|
|||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
var c config.Config
|
var c config.Config
|
||||||
conf.MustLoad(*configFile, &c)
|
conf.MustLoad(*configFile, &c)
|
||||||
|
c.Timeout = int64(time.Second * 15)
|
||||||
server := rest.MustNewServer(c.RestConf)
|
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {
|
||||||
|
}))
|
||||||
defer server.Stop()
|
defer server.Stop()
|
||||||
|
|
||||||
ctx := svc.NewServiceContext(c)
|
ctx := svc.NewServiceContext(c)
|
||||||
@ -26,21 +31,4 @@ func main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
// var testConfigFile = flag.String("f", "../etc/{{.serviceName}}.yaml", "the config file")
|
|
||||||
// var cnf config.Config
|
|
||||||
|
|
||||||
// func GetTestServer() *rest.Server {
|
|
||||||
// flag.Parse()
|
|
||||||
|
|
||||||
// conf.MustLoad(*testConfigFile, &cnf)
|
|
||||||
|
|
||||||
// server := rest.MustNewServer(cnf.RestConf)
|
|
||||||
// defer server.Stop()
|
|
||||||
|
|
||||||
// ctx := svc.NewServiceContext(cnf)
|
|
||||||
// handler.RegisterHandlers(server, ctx)
|
|
||||||
|
|
||||||
// fmt.Printf("Starting server at %s:%d...\n", cnf.Host, cnf.Port)
|
|
||||||
// return server
|
|
||||||
// }
|
|
@ -13,7 +13,8 @@ func main() {
|
|||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
var c gateway.GatewayConf
|
var c gateway.GatewayConf
|
||||||
conf.MustLoad(*configFile, &c)
|
conf.MustLoad(*configFile, &c)
|
||||||
|
c.Timeout = int64(time.Second * 15)
|
||||||
gw := gateway.MustNewServer(c)
|
gw := gateway.MustNewServer(c)
|
||||||
defer gw.Stop()
|
defer gw.Stop()
|
||||||
gw.Start()
|
gw.Start()
|
||||||
|
@ -19,7 +19,8 @@ func main() {
|
|||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
var c config.Config
|
var c config.Config
|
||||||
conf.MustLoad(*configFile, &c)
|
conf.MustLoad(*configFile, &c)
|
||||||
|
c.Timeout = int64(time.Second * 15)
|
||||||
ctx := svc.NewServiceContext(c)
|
ctx := svc.NewServiceContext(c)
|
||||||
|
|
||||||
s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
|
s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
|
||||||
|
11
goctl_template_backend/api/config.tpl
Normal file
11
goctl_template_backend/api/config.tpl
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import {{.authImport}}
|
||||||
|
|
||||||
|
type Config struct {
|
||||||
|
rest.RestConf
|
||||||
|
SourceMysql string
|
||||||
|
Auth types.Auth
|
||||||
|
{{.auth}}
|
||||||
|
{{.jwtTrans}}
|
||||||
|
}
|
59
goctl_template_backend/api/context.tpl
Normal file
59
goctl_template_backend/api/context.tpl
Normal file
@ -0,0 +1,59 @@
|
|||||||
|
package svc
|
||||||
|
|
||||||
|
import (
|
||||||
|
{{.configImport}}
|
||||||
|
"errors"
|
||||||
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
|
||||||
|
"fusenapi/initalize"
|
||||||
|
"fusenapi/model/gmodel"
|
||||||
|
|
||||||
|
"gorm.io/gorm"
|
||||||
|
"github.com/golang-jwt/jwt"
|
||||||
|
)
|
||||||
|
|
||||||
|
type ServiceContext struct {
|
||||||
|
Config {{.config}}
|
||||||
|
{{.middleware}}
|
||||||
|
MysqlConn *gorm.DB
|
||||||
|
AllModels *gmodel.AllModelsGen
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewServiceContext(c {{.config}}) *ServiceContext {
|
||||||
|
|
||||||
|
return &ServiceContext{
|
||||||
|
Config: c,
|
||||||
|
MysqlConn: initalize.InitMysql(c.SourceMysql),
|
||||||
|
AllModels: gmodel.NewAllModels(initalize.InitMysql(c.SourceMysql)),
|
||||||
|
{{.middlewareAssignment}}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func (svcCtx *ServiceContext) ParseJwtToken(r *http.Request) (jwt.MapClaims, error) {
|
||||||
|
AuthKey := r.Header.Get("Authorization")
|
||||||
|
|
||||||
|
if len(AuthKey) <= 50 {
|
||||||
|
return nil, errors.New(fmt.Sprint("Error parsing token, len:", len(AuthKey)))
|
||||||
|
}
|
||||||
|
|
||||||
|
token, err := jwt.Parse(AuthKey, func(token *jwt.Token) (interface{}, error) {
|
||||||
|
// 检查签名方法是否为 HS256
|
||||||
|
if _, ok := token.Method.(*jwt.SigningMethodHMAC); !ok {
|
||||||
|
return nil, fmt.Errorf("unexpected signing method: %v", token.Header["alg"])
|
||||||
|
}
|
||||||
|
// 返回用于验证签名的密钥
|
||||||
|
return []byte(svcCtx.Config.Auth.AccessSecret), nil
|
||||||
|
})
|
||||||
|
if err != nil {
|
||||||
|
return nil, errors.New(fmt.Sprint("Error parsing token:", err))
|
||||||
|
}
|
||||||
|
|
||||||
|
// 验证成功返回
|
||||||
|
if claims, ok := token.Claims.(jwt.MapClaims); ok && token.Valid {
|
||||||
|
return claims, nil
|
||||||
|
}
|
||||||
|
|
||||||
|
return nil, errors.New(fmt.Sprint("Invalid token", err))
|
||||||
|
}
|
8
goctl_template_backend/api/etc.tpl
Normal file
8
goctl_template_backend/api/etc.tpl
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Name: {{.serviceName}}
|
||||||
|
Host: {{.host}}
|
||||||
|
Port: {{.port}}
|
||||||
|
SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
||||||
|
Auth:
|
||||||
|
AccessSecret: fusen2023
|
||||||
|
AccessExpire: 2592000
|
||||||
|
RefreshAfter: 1592000
|
32
goctl_template_backend/api/handler.tpl
Normal file
32
goctl_template_backend/api/handler.tpl
Normal file
@ -0,0 +1,32 @@
|
|||||||
|
package {{.PkgName}}
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"
|
||||||
|
"reflect"
|
||||||
|
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
{{.ImportPackages}}
|
||||||
|
)
|
||||||
|
|
||||||
|
func {{.HandlerName}}(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
{{if .HasRequest}}var req types.{{.RequestType}}
|
||||||
|
userinfo, err := basic.RequestParseBackend(w, r, svcCtx, &req)
|
||||||
|
if err != nil {
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 创建一个业务逻辑层实例
|
||||||
|
{{end}}l := {{.LogicName}}.New{{.LogicType}}(r.Context(), svcCtx)
|
||||||
|
|
||||||
|
rl := reflect.ValueOf(l)
|
||||||
|
basic.BeforeLogic(w, r, rl)
|
||||||
|
|
||||||
|
{{if .HasResp}}resp{{end}} := l.{{.Call}}({{if .HasRequest}}&req, {{end}}userinfo)
|
||||||
|
|
||||||
|
if !basic.AfterLogic(w, r, rl, resp) {
|
||||||
|
basic.NormalAfterLogic(w, r, resp)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
39
goctl_template_backend/api/logic.tpl
Normal file
39
goctl_template_backend/api/logic.tpl
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
package {{.pkgName}}
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fusenapi/utils/auth"
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
{{.imports}}
|
||||||
|
)
|
||||||
|
|
||||||
|
type {{.logic}} struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{.logic}}(ctx context.Context, svcCtx *svc.ServiceContext) *{{.logic}} {
|
||||||
|
return &{{.logic}}{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// 处理进入前逻辑w,r
|
||||||
|
// func (l *{{.logic}}) BeforeLogic(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// }
|
||||||
|
|
||||||
|
// 处理逻辑后 w,r 如:重定向, resp 必须重新处理
|
||||||
|
// func (l *{{.logic}}) AfterLogic(w http.ResponseWriter, r *http.Request, resp *basic.Response) {
|
||||||
|
// // httpx.OkJsonCtx(r.Context(), w, resp)
|
||||||
|
// }
|
||||||
|
|
||||||
|
|
||||||
|
func (l *{{.logic}}) {{.function}}({{.request}}, userinfo *auth.UserInfo) (resp *basic.Response) {
|
||||||
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
|
// userinfo 传入值时, 一定不为null
|
||||||
|
|
||||||
|
{{.returnString}} resp.SetStatus(basic.CodeOK)
|
||||||
|
}
|
@ -3,24 +3,26 @@ package main
|
|||||||
import (
|
import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"net/http"
|
||||||
|
"time"
|
||||||
|
|
||||||
"fusenapi/server/faq/internal/config"
|
"fusenapi/utils/auth"
|
||||||
"fusenapi/server/faq/internal/handler"
|
|
||||||
"fusenapi/server/faq/internal/svc"
|
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/conf"
|
{{.importPackages}}
|
||||||
"github.com/zeromicro/go-zero/rest"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
var configFile = flag.String("f", "etc/faq.yaml", "the config file")
|
var configFile = flag.String("f", "etc/{{.serviceName}}.yaml", "the config file")
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
flag.Parse()
|
flag.Parse()
|
||||||
|
|
||||||
var c config.Config
|
var c config.Config
|
||||||
conf.MustLoad(*configFile, &c)
|
conf.MustLoad(*configFile, &c)
|
||||||
|
c.Timeout = int64(time.Second * 15)
|
||||||
|
|
||||||
|
server := rest.MustNewServer(c.RestConf, rest.WithCustomCors(auth.FsCors, func(w http.ResponseWriter) {
|
||||||
|
}))
|
||||||
|
|
||||||
server := rest.MustNewServer(c.RestConf)
|
|
||||||
defer server.Stop()
|
defer server.Stop()
|
||||||
|
|
||||||
ctx := svc.NewServiceContext(c)
|
ctx := svc.NewServiceContext(c)
|
||||||
@ -30,7 +32,9 @@ func main() {
|
|||||||
server.Start()
|
server.Start()
|
||||||
}
|
}
|
||||||
|
|
||||||
// var testConfigFile = flag.String("f", "../etc/faq.yaml", "the config file")
|
|
||||||
|
|
||||||
|
// var testConfigFile = flag.String("f", "../etc/{{.serviceName}}.yaml", "the config file")
|
||||||
// var cnf config.Config
|
// var cnf config.Config
|
||||||
|
|
||||||
// func GetTestServer() *rest.Server {
|
// func GetTestServer() *rest.Server {
|
||||||
@ -46,4 +50,4 @@ func main() {
|
|||||||
|
|
||||||
// fmt.Printf("Starting server at %s:%d...\n", cnf.Host, cnf.Port)
|
// fmt.Printf("Starting server at %s:%d...\n", cnf.Host, cnf.Port)
|
||||||
// return server
|
// return server
|
||||||
// }
|
// }
|
19
goctl_template_backend/api/middleware.tpl
Normal file
19
goctl_template_backend/api/middleware.tpl
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
package middleware
|
||||||
|
|
||||||
|
import "net/http"
|
||||||
|
|
||||||
|
type {{.name}} struct {
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{.name}}() *{{.name}} {
|
||||||
|
return &{{.name}}{}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *{{.name}})Handle(next http.HandlerFunc) http.HandlerFunc {
|
||||||
|
return func(w http.ResponseWriter, r *http.Request) {
|
||||||
|
// TODO generate middleware implement function, delete after code implementation
|
||||||
|
|
||||||
|
// Passthrough to next handler if need
|
||||||
|
next(w, r)
|
||||||
|
}
|
||||||
|
}
|
4
goctl_template_backend/api/route-addition.tpl
Normal file
4
goctl_template_backend/api/route-addition.tpl
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
|
||||||
|
server.AddRoutes(
|
||||||
|
{{.routes}} {{.jwt}}{{.signature}} {{.prefix}} {{.timeout}} {{.maxBytes}}
|
||||||
|
)
|
13
goctl_template_backend/api/routes.tpl
Normal file
13
goctl_template_backend/api/routes.tpl
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Code generated by goctl. DO NOT EDIT.
|
||||||
|
package handler
|
||||||
|
|
||||||
|
import (
|
||||||
|
"net/http"{{if .hasTimeout}}
|
||||||
|
"time"{{end}}
|
||||||
|
|
||||||
|
{{.importPackages}}
|
||||||
|
)
|
||||||
|
|
||||||
|
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
|
||||||
|
{{.routesAdditions}}
|
||||||
|
}
|
24
goctl_template_backend/api/template.tpl
Normal file
24
goctl_template_backend/api/template.tpl
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
syntax = "v1"
|
||||||
|
|
||||||
|
info (
|
||||||
|
title: // TODO: add title
|
||||||
|
desc: // TODO: add description
|
||||||
|
author: "{{.gitUser}}"
|
||||||
|
email: "{{.gitEmail}}"
|
||||||
|
)
|
||||||
|
|
||||||
|
type request {
|
||||||
|
// TODO: add members here and delete this comment
|
||||||
|
}
|
||||||
|
|
||||||
|
type response {
|
||||||
|
// TODO: add members here and delete this comment
|
||||||
|
}
|
||||||
|
|
||||||
|
service {{.serviceName}} {
|
||||||
|
@handler GetUser // TODO: set handler name and delete this comment
|
||||||
|
get /users/id/:userId(request) returns(response)
|
||||||
|
|
||||||
|
@handler CreateUser // TODO: set handler name and delete this comment
|
||||||
|
post /users/create(request)
|
||||||
|
}
|
50
goctl_template_backend/api/types.tpl
Normal file
50
goctl_template_backend/api/types.tpl
Normal file
@ -0,0 +1,50 @@
|
|||||||
|
// Code generated by goctl. DO NOT EDIT.
|
||||||
|
package types
|
||||||
|
import (
|
||||||
|
{{if .containsTime}}"time"{{end}}
|
||||||
|
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
)
|
||||||
|
{{.types}}
|
||||||
|
|
||||||
|
|
||||||
|
// Set 设置Response的Code和Message值
|
||||||
|
func (resp *Response) Set(Code int, Message string) *Response {
|
||||||
|
return &Response{
|
||||||
|
Code: Code,
|
||||||
|
Message: Message,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// Set 设置整个Response
|
||||||
|
func (resp *Response) SetWithData(Code int, Message string, Data interface{}) *Response {
|
||||||
|
return &Response{
|
||||||
|
Code: Code,
|
||||||
|
Message: Message,
|
||||||
|
Data: Data,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatus 设置默认StatusResponse(内部自定义) 默认msg, 可以带data, data只使用一个参数
|
||||||
|
func (resp *Response) SetStatus(sr *basic.StatusResponse, data ...interface{}) *Response {
|
||||||
|
newResp := &Response{
|
||||||
|
Code: sr.Code,
|
||||||
|
}
|
||||||
|
if len(data) == 1 {
|
||||||
|
newResp.Data = data[0]
|
||||||
|
}
|
||||||
|
return newResp
|
||||||
|
}
|
||||||
|
|
||||||
|
// SetStatusWithMessage 设置默认StatusResponse(内部自定义) 非默认msg, 可以带data, data只使用一个参数
|
||||||
|
func (resp *Response) SetStatusWithMessage(sr *basic.StatusResponse, msg string, data ...interface{}) *Response {
|
||||||
|
newResp := &Response{
|
||||||
|
Code: sr.Code,
|
||||||
|
Message: msg,
|
||||||
|
}
|
||||||
|
if len(data) == 1 {
|
||||||
|
newResp.Data = data[0]
|
||||||
|
}
|
||||||
|
return newResp
|
||||||
|
}
|
||||||
|
|
33
goctl_template_backend/docker/docker.tpl
Normal file
33
goctl_template_backend/docker/docker.tpl
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
FROM golang:{{.Version}}alpine AS builder
|
||||||
|
|
||||||
|
LABEL stage=gobuilder
|
||||||
|
|
||||||
|
ENV CGO_ENABLED 0
|
||||||
|
{{if .Chinese}}ENV GOPROXY https://goproxy.cn,direct
|
||||||
|
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
|
||||||
|
{{end}}{{if .HasTimezone}}
|
||||||
|
RUN apk update --no-cache && apk add --no-cache tzdata
|
||||||
|
{{end}}
|
||||||
|
WORKDIR /build
|
||||||
|
|
||||||
|
ADD go.mod .
|
||||||
|
ADD go.sum .
|
||||||
|
RUN go mod download
|
||||||
|
COPY . .
|
||||||
|
{{if .Argument}}COPY {{.GoRelPath}}/etc /app/etc
|
||||||
|
{{end}}RUN go build -ldflags="-s -w" -o /app/{{.ExeFile}} {{.GoMainFrom}}
|
||||||
|
|
||||||
|
|
||||||
|
FROM {{.BaseImage}}
|
||||||
|
|
||||||
|
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
|
||||||
|
{{if .HasTimezone}}COPY --from=builder /usr/share/zoneinfo/{{.Timezone}} /usr/share/zoneinfo/{{.Timezone}}
|
||||||
|
ENV TZ {{.Timezone}}
|
||||||
|
{{end}}
|
||||||
|
WORKDIR /app
|
||||||
|
COPY --from=builder /app/{{.ExeFile}} /app/{{.ExeFile}}{{if .Argument}}
|
||||||
|
COPY --from=builder /app/etc /app/etc{{end}}
|
||||||
|
{{if .HasPort}}
|
||||||
|
EXPOSE {{.Port}}
|
||||||
|
{{end}}
|
||||||
|
CMD ["./{{.ExeFile}}"{{.Argument}}]
|
18
goctl_template_backend/gateway/etc.tpl
Normal file
18
goctl_template_backend/gateway/etc.tpl
Normal file
@ -0,0 +1,18 @@
|
|||||||
|
Name: gateway-example # gateway name
|
||||||
|
Host: localhost # gateway host
|
||||||
|
Port: 8888 # gateway port
|
||||||
|
Upstreams: # upstreams
|
||||||
|
- Grpc: # grpc upstream
|
||||||
|
Target: 0.0.0.0:8080 # grpc target,the direct grpc server address,for only one node
|
||||||
|
# Endpoints: [0.0.0.0:8080,192.168.120.1:8080] # grpc endpoints, the grpc server address list, for multiple nodes
|
||||||
|
# Etcd: # etcd config, if you want to use etcd to discover the grpc server address
|
||||||
|
# Hosts: [127.0.0.1:2378,127.0.0.1:2379] # etcd hosts
|
||||||
|
# Key: greet.grpc # the discovery key
|
||||||
|
# protoset mode
|
||||||
|
ProtoSets:
|
||||||
|
- hello.pb
|
||||||
|
# Mappings can also be written in proto options
|
||||||
|
# Mappings: # routes mapping
|
||||||
|
# - Method: get
|
||||||
|
# Path: /ping
|
||||||
|
# RpcPath: hello.Hello/Ping
|
21
goctl_template_backend/gateway/main.tpl
Normal file
21
goctl_template_backend/gateway/main.tpl
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/conf"
|
||||||
|
"github.com/zeromicro/go-zero/gateway"
|
||||||
|
)
|
||||||
|
|
||||||
|
var configFile = flag.String("f", "etc/gateway.yaml", "config file")
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
var c gateway.GatewayConf
|
||||||
|
conf.MustLoad(*configFile, &c)
|
||||||
|
c.Timeout = int64(time.Second * 15)
|
||||||
|
gw := gateway.MustNewServer(c)
|
||||||
|
defer gw.Stop()
|
||||||
|
gw.Start()
|
||||||
|
}
|
117
goctl_template_backend/kube/deployment.tpl
Normal file
117
goctl_template_backend/kube/deployment.tpl
Normal file
@ -0,0 +1,117 @@
|
|||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
metadata:
|
||||||
|
name: {{.Name}}
|
||||||
|
namespace: {{.Namespace}}
|
||||||
|
labels:
|
||||||
|
app: {{.Name}}
|
||||||
|
spec:
|
||||||
|
replicas: {{.Replicas}}
|
||||||
|
revisionHistoryLimit: {{.Revisions}}
|
||||||
|
selector:
|
||||||
|
matchLabels:
|
||||||
|
app: {{.Name}}
|
||||||
|
template:
|
||||||
|
metadata:
|
||||||
|
labels:
|
||||||
|
app: {{.Name}}
|
||||||
|
spec:{{if .ServiceAccount}}
|
||||||
|
serviceAccountName: {{.ServiceAccount}}{{end}}
|
||||||
|
containers:
|
||||||
|
- name: {{.Name}}
|
||||||
|
image: {{.Image}}
|
||||||
|
{{if .ImagePullPolicy}}imagePullPolicy: {{.ImagePullPolicy}}
|
||||||
|
{{end}}ports:
|
||||||
|
- containerPort: {{.Port}}
|
||||||
|
readinessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: {{.Port}}
|
||||||
|
initialDelaySeconds: 5
|
||||||
|
periodSeconds: 10
|
||||||
|
livenessProbe:
|
||||||
|
tcpSocket:
|
||||||
|
port: {{.Port}}
|
||||||
|
initialDelaySeconds: 15
|
||||||
|
periodSeconds: 20
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: {{.RequestCpu}}m
|
||||||
|
memory: {{.RequestMem}}Mi
|
||||||
|
limits:
|
||||||
|
cpu: {{.LimitCpu}}m
|
||||||
|
memory: {{.LimitMem}}Mi
|
||||||
|
volumeMounts:
|
||||||
|
- name: timezone
|
||||||
|
mountPath: /etc/localtime
|
||||||
|
{{if .Secret}}imagePullSecrets:
|
||||||
|
- name: {{.Secret}}
|
||||||
|
{{end}}volumes:
|
||||||
|
- name: timezone
|
||||||
|
hostPath:
|
||||||
|
path: /usr/share/zoneinfo/Asia/Shanghai
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: v1
|
||||||
|
kind: Service
|
||||||
|
metadata:
|
||||||
|
name: {{.Name}}-svc
|
||||||
|
namespace: {{.Namespace}}
|
||||||
|
spec:
|
||||||
|
ports:
|
||||||
|
{{if .UseNodePort}}- nodePort: {{.NodePort}}
|
||||||
|
port: {{.Port}}
|
||||||
|
protocol: TCP
|
||||||
|
targetPort: {{.TargetPort}}
|
||||||
|
type: NodePort{{else}}- port: {{.Port}}
|
||||||
|
targetPort: {{.TargetPort}}{{end}}
|
||||||
|
selector:
|
||||||
|
app: {{.Name}}
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: autoscaling/v2beta2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: {{.Name}}-hpa-c
|
||||||
|
namespace: {{.Namespace}}
|
||||||
|
labels:
|
||||||
|
app: {{.Name}}-hpa-c
|
||||||
|
spec:
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: {{.Name}}
|
||||||
|
minReplicas: {{.MinReplicas}}
|
||||||
|
maxReplicas: {{.MaxReplicas}}
|
||||||
|
metrics:
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: cpu
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: 80
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
apiVersion: autoscaling/v2beta2
|
||||||
|
kind: HorizontalPodAutoscaler
|
||||||
|
metadata:
|
||||||
|
name: {{.Name}}-hpa-m
|
||||||
|
namespace: {{.Namespace}}
|
||||||
|
labels:
|
||||||
|
app: {{.Name}}-hpa-m
|
||||||
|
spec:
|
||||||
|
scaleTargetRef:
|
||||||
|
apiVersion: apps/v1
|
||||||
|
kind: Deployment
|
||||||
|
name: {{.Name}}
|
||||||
|
minReplicas: {{.MinReplicas}}
|
||||||
|
maxReplicas: {{.MaxReplicas}}
|
||||||
|
metrics:
|
||||||
|
- type: Resource
|
||||||
|
resource:
|
||||||
|
name: memory
|
||||||
|
target:
|
||||||
|
type: Utilization
|
||||||
|
averageUtilization: 80
|
37
goctl_template_backend/kube/job.tpl
Normal file
37
goctl_template_backend/kube/job.tpl
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
apiVersion: batch/v1
|
||||||
|
kind: CronJob
|
||||||
|
metadata:
|
||||||
|
name: {{.Name}}
|
||||||
|
namespace: {{.Namespace}}
|
||||||
|
spec:
|
||||||
|
successfulJobsHistoryLimit: {{.SuccessfulJobsHistoryLimit}}
|
||||||
|
schedule: "{{.Schedule}}"
|
||||||
|
jobTemplate:
|
||||||
|
spec:
|
||||||
|
template:
|
||||||
|
spec:{{if .ServiceAccount}}
|
||||||
|
serviceAccountName: {{.ServiceAccount}}{{end}}
|
||||||
|
{{end}}containers:
|
||||||
|
- name: {{.Name}}
|
||||||
|
image: # todo image url
|
||||||
|
resources:
|
||||||
|
requests:
|
||||||
|
cpu: {{.RequestCpu}}m
|
||||||
|
memory: {{.RequestMem}}Mi
|
||||||
|
limits:
|
||||||
|
cpu: {{.LimitCpu}}m
|
||||||
|
memory: {{.LimitMem}}Mi
|
||||||
|
command:
|
||||||
|
- ./{{.ServiceName}}
|
||||||
|
- -f
|
||||||
|
- ./{{.Name}}.yaml
|
||||||
|
volumeMounts:
|
||||||
|
- name: timezone
|
||||||
|
mountPath: /etc/localtime
|
||||||
|
imagePullSecrets:
|
||||||
|
- name: # registry secret, if no, remove this
|
||||||
|
restartPolicy: OnFailure
|
||||||
|
volumes:
|
||||||
|
- name: timezone
|
||||||
|
hostPath:
|
||||||
|
path: /usr/share/zoneinfo/Asia/Shanghai
|
14
goctl_template_backend/model/delete.tpl
Normal file
14
goctl_template_backend/model/delete.tpl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
func (m *default{{.upperStartCamelObject}}Model) Delete(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) error {
|
||||||
|
{{if .withCache}}{{if .containsIndexCache}}data, err:=m.FindOne(ctx, {{.lowerStartCamelPrimaryKey}})
|
||||||
|
if err!=nil{
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
{{end}} {{.keys}}
|
||||||
|
_, err {{if .containsIndexCache}}={{else}}:={{end}} m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) {
|
||||||
|
query := fmt.Sprintf("delete from %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}}", m.table)
|
||||||
|
return conn.ExecCtx(ctx, query, {{.lowerStartCamelPrimaryKey}})
|
||||||
|
}, {{.keyValues}}){{else}}query := fmt.Sprintf("delete from %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}}", m.table)
|
||||||
|
_,err:=m.conn.ExecCtx(ctx, query, {{.lowerStartCamelPrimaryKey}}){{end}}
|
||||||
|
return err
|
||||||
|
}
|
5
goctl_template_backend/model/err.tpl
Normal file
5
goctl_template_backend/model/err.tpl
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
package {{.pkg}}
|
||||||
|
|
||||||
|
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||||
|
|
||||||
|
var ErrNotFound = sqlx.ErrNotFound
|
1
goctl_template_backend/model/field.tpl
Normal file
1
goctl_template_backend/model/field.tpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
{{.name}} {{.type}} {{.tag}} {{if .hasComment}}// {{.comment}}{{end}}
|
@ -0,0 +1,8 @@
|
|||||||
|
func (m *default{{.upperStartCamelObject}}Model) formatPrimary(primary any) string {
|
||||||
|
return fmt.Sprintf("%s%v", {{.primaryKeyLeft}}, primary)
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *default{{.upperStartCamelObject}}Model) queryPrimary(ctx context.Context, conn sqlx.SqlConn, v, primary any) error {
|
||||||
|
query := fmt.Sprintf("select %s from %s where {{.originalPrimaryField}} = {{if .postgreSql}}$1{{else}}?{{end}} limit 1", {{.lowerStartCamelObject}}Rows, m.table )
|
||||||
|
return conn.QueryRowCtx(ctx, v, query, primary)
|
||||||
|
}
|
30
goctl_template_backend/model/find-one-by-field.tpl
Normal file
30
goctl_template_backend/model/find-one-by-field.tpl
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
func (m *default{{.upperStartCamelObject}}Model) FindOneBy{{.upperField}}(ctx context.Context, {{.in}}) (*{{.upperStartCamelObject}}, error) {
|
||||||
|
{{if .withCache}}{{.cacheKey}}
|
||||||
|
var resp {{.upperStartCamelObject}}
|
||||||
|
err := m.QueryRowIndexCtx(ctx, &resp, {{.cacheKeyVariable}}, m.formatPrimary, func(ctx context.Context, conn sqlx.SqlConn, v any) (i any, e error) {
|
||||||
|
query := fmt.Sprintf("select %s from %s where {{.originalField}} limit 1", {{.lowerStartCamelObject}}Rows, m.table)
|
||||||
|
if err := conn.QueryRowCtx(ctx, &resp, query, {{.lowerStartCamelField}}); err != nil {
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
return resp.{{.upperStartCamelPrimaryKey}}, nil
|
||||||
|
}, m.queryPrimary)
|
||||||
|
switch err {
|
||||||
|
case nil:
|
||||||
|
return &resp, nil
|
||||||
|
case sqlc.ErrNotFound:
|
||||||
|
return nil, ErrNotFound
|
||||||
|
default:
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}{{else}}var resp {{.upperStartCamelObject}}
|
||||||
|
query := fmt.Sprintf("select %s from %s where {{.originalField}} limit 1", {{.lowerStartCamelObject}}Rows, m.table )
|
||||||
|
err := m.conn.QueryRowCtx(ctx, &resp, query, {{.lowerStartCamelField}})
|
||||||
|
switch err {
|
||||||
|
case nil:
|
||||||
|
return &resp, nil
|
||||||
|
case sqlc.ErrNotFound:
|
||||||
|
return nil, ErrNotFound
|
||||||
|
default:
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}{{end}}
|
26
goctl_template_backend/model/find-one.tpl
Normal file
26
goctl_template_backend/model/find-one.tpl
Normal file
@ -0,0 +1,26 @@
|
|||||||
|
func (m *default{{.upperStartCamelObject}}Model) FindOne(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) (*{{.upperStartCamelObject}}, error) {
|
||||||
|
{{if .withCache}}{{.cacheKey}}
|
||||||
|
var resp {{.upperStartCamelObject}}
|
||||||
|
err := m.QueryRowCtx(ctx, &resp, {{.cacheKeyVariable}}, func(ctx context.Context, conn sqlx.SqlConn, v any) error {
|
||||||
|
query := fmt.Sprintf("select %s from %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}} limit 1", {{.lowerStartCamelObject}}Rows, m.table)
|
||||||
|
return conn.QueryRowCtx(ctx, v, query, {{.lowerStartCamelPrimaryKey}})
|
||||||
|
})
|
||||||
|
switch err {
|
||||||
|
case nil:
|
||||||
|
return &resp, nil
|
||||||
|
case sqlc.ErrNotFound:
|
||||||
|
return nil, ErrNotFound
|
||||||
|
default:
|
||||||
|
return nil, err
|
||||||
|
}{{else}}query := fmt.Sprintf("select %s from %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}} limit 1", {{.lowerStartCamelObject}}Rows, m.table)
|
||||||
|
var resp {{.upperStartCamelObject}}
|
||||||
|
err := m.conn.QueryRowCtx(ctx, &resp, query, {{.lowerStartCamelPrimaryKey}})
|
||||||
|
switch err {
|
||||||
|
case nil:
|
||||||
|
return &resp, nil
|
||||||
|
case sqlc.ErrNotFound:
|
||||||
|
return nil, ErrNotFound
|
||||||
|
default:
|
||||||
|
return nil, err
|
||||||
|
}{{end}}
|
||||||
|
}
|
13
goctl_template_backend/model/import-no-cache.tpl
Normal file
13
goctl_template_backend/model/import-no-cache.tpl
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
{{if .time}}"time"{{end}}
|
||||||
|
|
||||||
|
{{if .containsPQ}}"github.com/lib/pq"{{end}}
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||||
|
"github.com/zeromicro/go-zero/core/stringx"
|
||||||
|
)
|
14
goctl_template_backend/model/import.tpl
Normal file
14
goctl_template_backend/model/import.tpl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"database/sql"
|
||||||
|
"fmt"
|
||||||
|
"strings"
|
||||||
|
{{if .time}}"time"{{end}}
|
||||||
|
|
||||||
|
{{if .containsPQ}}"github.com/lib/pq"{{end}}
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/builder"
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/cache"
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/sqlc"
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||||
|
"github.com/zeromicro/go-zero/core/stringx"
|
||||||
|
)
|
9
goctl_template_backend/model/insert.tpl
Normal file
9
goctl_template_backend/model/insert.tpl
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
func (m *default{{.upperStartCamelObject}}Model) Insert(ctx context.Context, data *{{.upperStartCamelObject}}) (sql.Result,error) {
|
||||||
|
{{if .withCache}}{{.keys}}
|
||||||
|
ret, err := m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) {
|
||||||
|
query := fmt.Sprintf("insert into %s (%s) values ({{.expression}})", m.table, {{.lowerStartCamelObject}}RowsExpectAutoSet)
|
||||||
|
return conn.ExecCtx(ctx, query, {{.expressionValues}})
|
||||||
|
}, {{.keyValues}}){{else}}query := fmt.Sprintf("insert into %s (%s) values ({{.expression}})", m.table, {{.lowerStartCamelObject}}RowsExpectAutoSet)
|
||||||
|
ret,err:=m.conn.ExecCtx(ctx, query, {{.expressionValues}}){{end}}
|
||||||
|
return ret,err
|
||||||
|
}
|
1
goctl_template_backend/model/interface-delete.tpl
Normal file
1
goctl_template_backend/model/interface-delete.tpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
Delete(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) error
|
@ -0,0 +1 @@
|
|||||||
|
FindOneBy{{.upperField}}(ctx context.Context, {{.in}}) (*{{.upperStartCamelObject}}, error)
|
1
goctl_template_backend/model/interface-find-one.tpl
Normal file
1
goctl_template_backend/model/interface-find-one.tpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
FindOne(ctx context.Context, {{.lowerStartCamelPrimaryKey}} {{.dataType}}) (*{{.upperStartCamelObject}}, error)
|
1
goctl_template_backend/model/interface-insert.tpl
Normal file
1
goctl_template_backend/model/interface-insert.tpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
Insert(ctx context.Context, data *{{.upperStartCamelObject}}) (sql.Result,error)
|
1
goctl_template_backend/model/interface-update.tpl
Normal file
1
goctl_template_backend/model/interface-update.tpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
Update(ctx context.Context, {{if .containsIndexCache}}newData{{else}}data{{end}} *{{.upperStartCamelObject}}) error
|
13
goctl_template_backend/model/model-gen.tpl
Normal file
13
goctl_template_backend/model/model-gen.tpl
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
// Code generated by goctl. DO NOT EDIT.
|
||||||
|
|
||||||
|
package {{.pkg}}
|
||||||
|
{{.imports}}
|
||||||
|
{{.vars}}
|
||||||
|
{{.types}}
|
||||||
|
{{.new}}
|
||||||
|
{{.delete}}
|
||||||
|
{{.find}}
|
||||||
|
{{.insert}}
|
||||||
|
{{.update}}
|
||||||
|
{{.extraMethod}}
|
||||||
|
{{.tableName}}
|
6
goctl_template_backend/model/model-new.tpl
Normal file
6
goctl_template_backend/model/model-new.tpl
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
func new{{.upperStartCamelObject}}Model(conn sqlx.SqlConn{{if .withCache}}, c cache.CacheConf, opts ...cache.Option{{end}}) *default{{.upperStartCamelObject}}Model {
|
||||||
|
return &default{{.upperStartCamelObject}}Model{
|
||||||
|
{{if .withCache}}CachedConn: sqlc.NewConn(conn, c, opts...){{else}}conn:conn{{end}},
|
||||||
|
table: {{.table}},
|
||||||
|
}
|
||||||
|
}
|
30
goctl_template_backend/model/model.tpl
Normal file
30
goctl_template_backend/model/model.tpl
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
package {{.pkg}}
|
||||||
|
{{if .withCache}}
|
||||||
|
import (
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/cache"
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||||
|
)
|
||||||
|
{{else}}
|
||||||
|
|
||||||
|
import "github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||||
|
{{end}}
|
||||||
|
var _ {{.upperStartCamelObject}}Model = (*custom{{.upperStartCamelObject}}Model)(nil)
|
||||||
|
|
||||||
|
type (
|
||||||
|
// {{.upperStartCamelObject}}Model is an interface to be customized, add more methods here,
|
||||||
|
// and implement the added methods in custom{{.upperStartCamelObject}}Model.
|
||||||
|
{{.upperStartCamelObject}}Model interface {
|
||||||
|
{{.lowerStartCamelObject}}Model
|
||||||
|
}
|
||||||
|
|
||||||
|
custom{{.upperStartCamelObject}}Model struct {
|
||||||
|
*default{{.upperStartCamelObject}}Model
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
// New{{.upperStartCamelObject}}Model returns a model for the database table.
|
||||||
|
func New{{.upperStartCamelObject}}Model(conn sqlx.SqlConn{{if .withCache}}, c cache.CacheConf, opts ...cache.Option{{end}}) {{.upperStartCamelObject}}Model {
|
||||||
|
return &custom{{.upperStartCamelObject}}Model{
|
||||||
|
default{{.upperStartCamelObject}}Model: new{{.upperStartCamelObject}}Model(conn{{if .withCache}}, c, opts...{{end}}),
|
||||||
|
}
|
||||||
|
}
|
3
goctl_template_backend/model/table-name.tpl
Normal file
3
goctl_template_backend/model/table-name.tpl
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
func (m *default{{.upperStartCamelObject}}Model) tableName() string {
|
||||||
|
return m.table
|
||||||
|
}
|
1
goctl_template_backend/model/tag.tpl
Normal file
1
goctl_template_backend/model/tag.tpl
Normal file
@ -0,0 +1 @@
|
|||||||
|
`db:"{{.field}}"`
|
14
goctl_template_backend/model/types.tpl
Normal file
14
goctl_template_backend/model/types.tpl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
type (
|
||||||
|
{{.lowerStartCamelObject}}Model interface{
|
||||||
|
{{.method}}
|
||||||
|
}
|
||||||
|
|
||||||
|
default{{.upperStartCamelObject}}Model struct {
|
||||||
|
{{if .withCache}}sqlc.CachedConn{{else}}conn sqlx.SqlConn{{end}}
|
||||||
|
table string
|
||||||
|
}
|
||||||
|
|
||||||
|
{{.upperStartCamelObject}} struct {
|
||||||
|
{{.fields}}
|
||||||
|
}
|
||||||
|
)
|
14
goctl_template_backend/model/update.tpl
Normal file
14
goctl_template_backend/model/update.tpl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
func (m *default{{.upperStartCamelObject}}Model) Update(ctx context.Context, {{if .containsIndexCache}}newData{{else}}data{{end}} *{{.upperStartCamelObject}}) error {
|
||||||
|
{{if .withCache}}{{if .containsIndexCache}}data, err:=m.FindOne(ctx, newData.{{.upperStartCamelPrimaryKey}})
|
||||||
|
if err!=nil{
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
{{end}} {{.keys}}
|
||||||
|
_, {{if .containsIndexCache}}err{{else}}err:{{end}}= m.ExecCtx(ctx, func(ctx context.Context, conn sqlx.SqlConn) (result sql.Result, err error) {
|
||||||
|
query := fmt.Sprintf("update %s set %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}}", m.table, {{.lowerStartCamelObject}}RowsWithPlaceHolder)
|
||||||
|
return conn.ExecCtx(ctx, query, {{.expressionValues}})
|
||||||
|
}, {{.keyValues}}){{else}}query := fmt.Sprintf("update %s set %s where {{.originalPrimaryKey}} = {{if .postgreSql}}$1{{else}}?{{end}}", m.table, {{.lowerStartCamelObject}}RowsWithPlaceHolder)
|
||||||
|
_,err:=m.conn.ExecCtx(ctx, query, {{.expressionValues}}){{end}}
|
||||||
|
return err
|
||||||
|
}
|
8
goctl_template_backend/model/var.tpl
Normal file
8
goctl_template_backend/model/var.tpl
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
var (
|
||||||
|
{{.lowerStartCamelObject}}FieldNames = builder.RawFieldNames(&{{.upperStartCamelObject}}{}{{if .postgreSql}}, true{{end}})
|
||||||
|
{{.lowerStartCamelObject}}Rows = strings.Join({{.lowerStartCamelObject}}FieldNames, ",")
|
||||||
|
{{.lowerStartCamelObject}}RowsExpectAutoSet = {{if .postgreSql}}strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, {{if .autoIncrement}}"{{.originalPrimaryKey}}", {{end}} {{.ignoreColumns}}), ","){{else}}strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, {{if .autoIncrement}}"{{.originalPrimaryKey}}", {{end}} {{.ignoreColumns}}), ","){{end}}
|
||||||
|
{{.lowerStartCamelObject}}RowsWithPlaceHolder = {{if .postgreSql}}builder.PostgreSqlJoin(stringx.Remove({{.lowerStartCamelObject}}FieldNames, "{{.originalPrimaryKey}}", {{.ignoreColumns}})){{else}}strings.Join(stringx.Remove({{.lowerStartCamelObject}}FieldNames, "{{.originalPrimaryKey}}", {{.ignoreColumns}}), "=?,") + "=?"{{end}}
|
||||||
|
|
||||||
|
{{if .withCache}}{{.cacheKeys}}{{end}}
|
||||||
|
)
|
12
goctl_template_backend/mongo/err.tpl
Normal file
12
goctl_template_backend/mongo/err.tpl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"errors"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/mon"
|
||||||
|
)
|
||||||
|
|
||||||
|
var (
|
||||||
|
ErrNotFound = mon.ErrNotFound
|
||||||
|
ErrInvalidObjectId = errors.New("invalid objectId")
|
||||||
|
)
|
78
goctl_template_backend/mongo/model.tpl
Normal file
78
goctl_template_backend/mongo/model.tpl
Normal file
@ -0,0 +1,78 @@
|
|||||||
|
// Code generated by goctl. DO NOT EDIT.
|
||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
"time"
|
||||||
|
|
||||||
|
{{if .Cache}}"github.com/zeromicro/go-zero/core/stores/monc"{{else}}"github.com/zeromicro/go-zero/core/stores/mon"{{end}}
|
||||||
|
"go.mongodb.org/mongo-driver/bson"
|
||||||
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
|
"go.mongodb.org/mongo-driver/mongo"
|
||||||
|
)
|
||||||
|
|
||||||
|
{{if .Cache}}var prefix{{.Type}}CacheKey = "cache:{{.lowerType}}:"{{end}}
|
||||||
|
|
||||||
|
type {{.lowerType}}Model interface{
|
||||||
|
Insert(ctx context.Context,data *{{.Type}}) error
|
||||||
|
FindOne(ctx context.Context,id string) (*{{.Type}}, error)
|
||||||
|
Update(ctx context.Context,data *{{.Type}}) (*mongo.UpdateResult, error)
|
||||||
|
Delete(ctx context.Context,id string) (int64, error)
|
||||||
|
}
|
||||||
|
|
||||||
|
type default{{.Type}}Model struct {
|
||||||
|
conn {{if .Cache}}*monc.Model{{else}}*mon.Model{{end}}
|
||||||
|
}
|
||||||
|
|
||||||
|
func newDefault{{.Type}}Model(conn {{if .Cache}}*monc.Model{{else}}*mon.Model{{end}}) *default{{.Type}}Model {
|
||||||
|
return &default{{.Type}}Model{conn: conn}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
func (m *default{{.Type}}Model) Insert(ctx context.Context, data *{{.Type}}) error {
|
||||||
|
if data.ID.IsZero() {
|
||||||
|
data.ID = primitive.NewObjectID()
|
||||||
|
data.CreateAt = time.Now()
|
||||||
|
data.UpdateAt = time.Now()
|
||||||
|
}
|
||||||
|
|
||||||
|
{{if .Cache}}key := prefix{{.Type}}CacheKey + data.ID.Hex(){{end}}
|
||||||
|
_, err := m.conn.InsertOne(ctx, {{if .Cache}}key, {{end}} data)
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *default{{.Type}}Model) FindOne(ctx context.Context, id string) (*{{.Type}}, error) {
|
||||||
|
oid, err := primitive.ObjectIDFromHex(id)
|
||||||
|
if err != nil {
|
||||||
|
return nil, ErrInvalidObjectId
|
||||||
|
}
|
||||||
|
|
||||||
|
var data {{.Type}}
|
||||||
|
{{if .Cache}}key := prefix{{.Type}}CacheKey + id{{end}}
|
||||||
|
err = m.conn.FindOne(ctx, {{if .Cache}}key, {{end}}&data, bson.M{"_id": oid})
|
||||||
|
switch err {
|
||||||
|
case nil:
|
||||||
|
return &data, nil
|
||||||
|
case {{if .Cache}}monc{{else}}mon{{end}}.ErrNotFound:
|
||||||
|
return nil, ErrNotFound
|
||||||
|
default:
|
||||||
|
return nil, err
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *default{{.Type}}Model) Update(ctx context.Context, data *{{.Type}}) (*mongo.UpdateResult, error) {
|
||||||
|
data.UpdateAt = time.Now()
|
||||||
|
{{if .Cache}}key := prefix{{.Type}}CacheKey + data.ID.Hex(){{end}}
|
||||||
|
res, err := m.conn.UpdateOne(ctx, {{if .Cache}}key, {{end}}bson.M{"_id": data.ID}, bson.M{"$set": data})
|
||||||
|
return res, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (m *default{{.Type}}Model) Delete(ctx context.Context, id string) (int64, error) {
|
||||||
|
oid, err := primitive.ObjectIDFromHex(id)
|
||||||
|
if err != nil {
|
||||||
|
return 0, ErrInvalidObjectId
|
||||||
|
}
|
||||||
|
{{if .Cache}}key := prefix{{.Type}}CacheKey +id{{end}}
|
||||||
|
res, err := m.conn.DeleteOne(ctx, {{if .Cache}}key, {{end}}bson.M{"_id": oid})
|
||||||
|
return res, err
|
||||||
|
}
|
38
goctl_template_backend/mongo/model_custom.tpl
Normal file
38
goctl_template_backend/mongo/model_custom.tpl
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
{{if .Cache}}import (
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/cache"
|
||||||
|
"github.com/zeromicro/go-zero/core/stores/monc"
|
||||||
|
){{else}}import "github.com/zeromicro/go-zero/core/stores/mon"{{end}}
|
||||||
|
|
||||||
|
{{if .Easy}}
|
||||||
|
const {{.Type}}CollectionName = "{{.snakeType}}"
|
||||||
|
{{end}}
|
||||||
|
|
||||||
|
var _ {{.Type}}Model = (*custom{{.Type}}Model)(nil)
|
||||||
|
|
||||||
|
type (
|
||||||
|
// {{.Type}}Model is an interface to be customized, add more methods here,
|
||||||
|
// and implement the added methods in custom{{.Type}}Model.
|
||||||
|
{{.Type}}Model interface {
|
||||||
|
{{.lowerType}}Model
|
||||||
|
}
|
||||||
|
|
||||||
|
custom{{.Type}}Model struct {
|
||||||
|
*default{{.Type}}Model
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
|
||||||
|
// New{{.Type}}Model returns a model for the mongo.
|
||||||
|
{{if .Easy}}func New{{.Type}}Model(url, db string{{if .Cache}}, c cache.CacheConf{{end}}) {{.Type}}Model {
|
||||||
|
conn := {{if .Cache}}monc{{else}}mon{{end}}.MustNewModel(url, db, {{.Type}}CollectionName{{if .Cache}}, c{{end}})
|
||||||
|
return &custom{{.Type}}Model{
|
||||||
|
default{{.Type}}Model: newDefault{{.Type}}Model(conn),
|
||||||
|
}
|
||||||
|
}{{else}}func New{{.Type}}Model(url, db, collection string{{if .Cache}}, c cache.CacheConf{{end}}) {{.Type}}Model {
|
||||||
|
conn := {{if .Cache}}monc{{else}}mon{{end}}.MustNewModel(url, db, collection{{if .Cache}}, c{{end}})
|
||||||
|
return &custom{{.Type}}Model{
|
||||||
|
default{{.Type}}Model: newDefault{{.Type}}Model(conn),
|
||||||
|
}
|
||||||
|
}{{end}}
|
14
goctl_template_backend/mongo/model_types.tpl
Normal file
14
goctl_template_backend/mongo/model_types.tpl
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"time"
|
||||||
|
|
||||||
|
"go.mongodb.org/mongo-driver/bson/primitive"
|
||||||
|
)
|
||||||
|
|
||||||
|
type {{.Type}} struct {
|
||||||
|
ID primitive.ObjectID `bson:"_id,omitempty" json:"id,omitempty"`
|
||||||
|
// TODO: Fill your own fields
|
||||||
|
UpdateAt time.Time `bson:"updateAt,omitempty" json:"updateAt,omitempty"`
|
||||||
|
CreateAt time.Time `bson:"createAt,omitempty" json:"createAt,omitempty"`
|
||||||
|
}
|
12
goctl_template_backend/newapi/newtemplate.tpl
Normal file
12
goctl_template_backend/newapi/newtemplate.tpl
Normal file
@ -0,0 +1,12 @@
|
|||||||
|
type Request {
|
||||||
|
Name string `path:"name,options=you|me"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type Response {
|
||||||
|
Message string `json:"message"`
|
||||||
|
}
|
||||||
|
|
||||||
|
service {{.name}}-api {
|
||||||
|
@handler {{.handler}}Handler
|
||||||
|
get /from/:name(Request) returns (Response)
|
||||||
|
}
|
33
goctl_template_backend/rpc/call.tpl
Normal file
33
goctl_template_backend/rpc/call.tpl
Normal file
@ -0,0 +1,33 @@
|
|||||||
|
{{.head}}
|
||||||
|
|
||||||
|
package {{.filePackage}}
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
{{.pbPackage}}
|
||||||
|
{{if ne .pbPackage .protoGoPackage}}{{.protoGoPackage}}{{end}}
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/zrpc"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
)
|
||||||
|
|
||||||
|
type (
|
||||||
|
{{.alias}}
|
||||||
|
|
||||||
|
{{.serviceName}} interface {
|
||||||
|
{{.interface}}
|
||||||
|
}
|
||||||
|
|
||||||
|
default{{.serviceName}} struct {
|
||||||
|
cli zrpc.Client
|
||||||
|
}
|
||||||
|
)
|
||||||
|
|
||||||
|
func New{{.serviceName}}(cli zrpc.Client) {{.serviceName}} {
|
||||||
|
return &default{{.serviceName}}{
|
||||||
|
cli: cli,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{{.functions}}
|
7
goctl_template_backend/rpc/config.tpl
Normal file
7
goctl_template_backend/rpc/config.tpl
Normal file
@ -0,0 +1,7 @@
|
|||||||
|
package config
|
||||||
|
|
||||||
|
import "github.com/zeromicro/go-zero/zrpc"
|
||||||
|
|
||||||
|
type Config struct {
|
||||||
|
zrpc.RpcServerConf
|
||||||
|
}
|
6
goctl_template_backend/rpc/etc.tpl
Normal file
6
goctl_template_backend/rpc/etc.tpl
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
Name: {{.serviceName}}.rpc
|
||||||
|
ListenOn: 0.0.0.0:8080
|
||||||
|
Etcd:
|
||||||
|
Hosts:
|
||||||
|
- 127.0.0.1:2379
|
||||||
|
Key: {{.serviceName}}.rpc
|
6
goctl_template_backend/rpc/logic-func.tpl
Normal file
6
goctl_template_backend/rpc/logic-func.tpl
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
{{if .hasComment}}{{.comment}}{{end}}
|
||||||
|
func (l *{{.logicName}}) {{.method}} ({{if .hasReq}}in {{.request}}{{if .stream}},stream {{.streamBody}}{{end}}{{else}}stream {{.streamBody}}{{end}}) ({{if .hasReply}}{{.response}},{{end}} error) {
|
||||||
|
// todo: add your logic here and delete this line
|
||||||
|
|
||||||
|
return {{if .hasReply}}&{{.responseType}}{},{{end}} nil
|
||||||
|
}
|
24
goctl_template_backend/rpc/logic.tpl
Normal file
24
goctl_template_backend/rpc/logic.tpl
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
package {{.packageName}}
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
{{.imports}}
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type {{.logicName}} struct {
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
logx.Logger
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{.logicName}}(ctx context.Context,svcCtx *svc.ServiceContext) *{{.logicName}} {
|
||||||
|
return &{{.logicName}}{
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
{{.functions}}
|
37
goctl_template_backend/rpc/main.tpl
Normal file
37
goctl_template_backend/rpc/main.tpl
Normal file
@ -0,0 +1,37 @@
|
|||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"flag"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
|
{{.imports}}
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/conf"
|
||||||
|
"github.com/zeromicro/go-zero/core/service"
|
||||||
|
"github.com/zeromicro/go-zero/zrpc"
|
||||||
|
"google.golang.org/grpc"
|
||||||
|
"google.golang.org/grpc/reflection"
|
||||||
|
)
|
||||||
|
|
||||||
|
var configFile = flag.String("f", "etc/{{.serviceName}}.yaml", "the config file")
|
||||||
|
|
||||||
|
func main() {
|
||||||
|
flag.Parse()
|
||||||
|
|
||||||
|
var c config.Config
|
||||||
|
conf.MustLoad(*configFile, &c)
|
||||||
|
c.Timeout = int64(time.Second * 15)
|
||||||
|
ctx := svc.NewServiceContext(c)
|
||||||
|
|
||||||
|
s := zrpc.MustNewServer(c.RpcServerConf, func(grpcServer *grpc.Server) {
|
||||||
|
{{range .serviceNames}} {{.Pkg}}.Register{{.Service}}Server(grpcServer, {{.ServerPkg}}.New{{.Service}}Server(ctx))
|
||||||
|
{{end}}
|
||||||
|
if c.Mode == service.DevMode || c.Mode == service.TestMode {
|
||||||
|
reflection.Register(grpcServer)
|
||||||
|
}
|
||||||
|
})
|
||||||
|
defer s.Stop()
|
||||||
|
|
||||||
|
fmt.Printf("Starting rpc server at %s...\n", c.ListenOn)
|
||||||
|
s.Start()
|
||||||
|
}
|
6
goctl_template_backend/rpc/server-func.tpl
Normal file
6
goctl_template_backend/rpc/server-func.tpl
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
|
||||||
|
{{if .hasComment}}{{.comment}}{{end}}
|
||||||
|
func (s *{{.server}}Server) {{.method}} ({{if .notStream}}ctx context.Context,{{if .hasReq}} in {{.request}}{{end}}{{else}}{{if .hasReq}} in {{.request}},{{end}}stream {{.streamBody}}{{end}}) ({{if .notStream}}{{.response}},{{end}}error) {
|
||||||
|
l := {{.logicPkg}}.New{{.logicName}}({{if .notStream}}ctx,{{else}}stream.Context(),{{end}}s.svcCtx)
|
||||||
|
return l.{{.method}}({{if .hasReq}}in{{if .stream}} ,stream{{end}}{{else}}{{if .stream}}stream{{end}}{{end}})
|
||||||
|
}
|
22
goctl_template_backend/rpc/server.tpl
Normal file
22
goctl_template_backend/rpc/server.tpl
Normal file
@ -0,0 +1,22 @@
|
|||||||
|
{{.head}}
|
||||||
|
|
||||||
|
package server
|
||||||
|
|
||||||
|
import (
|
||||||
|
{{if .notStream}}"context"{{end}}
|
||||||
|
|
||||||
|
{{.imports}}
|
||||||
|
)
|
||||||
|
|
||||||
|
type {{.server}}Server struct {
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
{{.unimplementedServer}}
|
||||||
|
}
|
||||||
|
|
||||||
|
func New{{.server}}Server(svcCtx *svc.ServiceContext) *{{.server}}Server {
|
||||||
|
return &{{.server}}Server{
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
{{.funcs}}
|
13
goctl_template_backend/rpc/svc.tpl
Normal file
13
goctl_template_backend/rpc/svc.tpl
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package svc
|
||||||
|
|
||||||
|
import {{.imports}}
|
||||||
|
|
||||||
|
type ServiceContext struct {
|
||||||
|
Config config.Config
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewServiceContext(c config.Config) *ServiceContext {
|
||||||
|
return &ServiceContext{
|
||||||
|
Config:c,
|
||||||
|
}
|
||||||
|
}
|
16
goctl_template_backend/rpc/template.tpl
Normal file
16
goctl_template_backend/rpc/template.tpl
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
syntax = "proto3";
|
||||||
|
|
||||||
|
package {{.package}};
|
||||||
|
option go_package="./{{.package}}";
|
||||||
|
|
||||||
|
message Request {
|
||||||
|
string ping = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
message Response {
|
||||||
|
string pong = 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
service {{.serviceName}} {
|
||||||
|
rpc Ping(Request) returns(Response);
|
||||||
|
}
|
@ -7,7 +7,6 @@ import (
|
|||||||
"time"
|
"time"
|
||||||
)
|
)
|
||||||
|
|
||||||
// SourceMysql: fusentest:XErSYmLELKMnf3Dh@tcp(110.41.19.98:3306)/fusentest
|
|
||||||
// 初始化mysql
|
// 初始化mysql
|
||||||
func InitMysql(sourceMysql string) *gorm.DB {
|
func InitMysql(sourceMysql string) *gorm.DB {
|
||||||
dsn := sourceMysql + "?charset=utf8mb4&parseTime=true"
|
dsn := sourceMysql + "?charset=utf8mb4&parseTime=true"
|
||||||
|
@ -21,6 +21,11 @@ type FsAddress struct {
|
|||||||
Status *int64 `gorm:"default:0;" json:"status"` // 1正常 0异常
|
Status *int64 `gorm:"default:0;" json:"status"` // 1正常 0异常
|
||||||
IsDefault *int64 `gorm:"index;default:0;" json:"is_default"` // 1默认地址,0非默认地址
|
IsDefault *int64 `gorm:"index;default:0;" json:"is_default"` // 1默认地址,0非默认地址
|
||||||
}
|
}
|
||||||
type FsAddressModel struct{ db *gorm.DB }
|
type FsAddressModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
func NewFsAddressModel(db *gorm.DB) *FsAddressModel { return &FsAddressModel{db} }
|
func NewFsAddressModel(db *gorm.DB) *FsAddressModel {
|
||||||
|
return &FsAddressModel{db: db, name: "fs_address"}
|
||||||
|
}
|
||||||
|
@ -52,12 +52,12 @@ func (a *FsAddressModel) CreateOne(ctx context.Context, address *FsAddress) (res
|
|||||||
func (a *FsAddressModel) UpdateAddAddress(ctx context.Context, address *FsAddress) (err error) {
|
func (a *FsAddressModel) UpdateAddAddress(ctx context.Context, address *FsAddress) (err error) {
|
||||||
err = a.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
err = a.db.WithContext(ctx).Transaction(func(tx *gorm.DB) error {
|
||||||
if *address.IsDefault > 0 {
|
if *address.IsDefault > 0 {
|
||||||
err = tx.Where("user_id = ? and is_default = 1", address.UserId).Update("is_default", 0).Error
|
err = tx.Model(&FsAddress{}).Where("user_id = ? and is_default = 1 ", address.UserId).Update("is_default", 0).Error
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return a.db.WithContext(ctx).Where("id = ? and user_id = ?", address.Id, address.UserId).Omit("id", "user_id").Updates(address).Error
|
return tx.Model(&FsAddress{}).Where("id = ? and user_id = ?", address.Id, address.UserId).Omit("id", "user_id").Updates(address).Error
|
||||||
})
|
})
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
@ -11,6 +11,11 @@ type FsAuthAssignment struct {
|
|||||||
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间
|
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间
|
||||||
// FsAuthAssignmentIbfk1 foreign `gorm:"" json:"fs_auth_assignment_ibfk_1"`//
|
// FsAuthAssignmentIbfk1 foreign `gorm:"" json:"fs_auth_assignment_ibfk_1"`//
|
||||||
}
|
}
|
||||||
type FsAuthAssignmentModel struct{ db *gorm.DB }
|
type FsAuthAssignmentModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
func NewFsAuthAssignmentModel(db *gorm.DB) *FsAuthAssignmentModel { return &FsAuthAssignmentModel{db} }
|
func NewFsAuthAssignmentModel(db *gorm.DB) *FsAuthAssignmentModel {
|
||||||
|
return &FsAuthAssignmentModel{db: db, name: "fs_auth_assignment"}
|
||||||
|
}
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
package gmodel
|
package gmodel
|
||||||
// TODO: 使用model的属性做你想做的
|
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
|
@ -11,6 +11,11 @@ type FsAuthItemChild struct {
|
|||||||
// FsAuthItemChildIbfk1 foreign `gorm:"" json:"fs_auth_item_child_ibfk_1"`//
|
// FsAuthItemChildIbfk1 foreign `gorm:"" json:"fs_auth_item_child_ibfk_1"`//
|
||||||
// FsAuthItemChildIbfk2 foreign `gorm:"" json:"fs_auth_item_child_ibfk_2"`//
|
// FsAuthItemChildIbfk2 foreign `gorm:"" json:"fs_auth_item_child_ibfk_2"`//
|
||||||
}
|
}
|
||||||
type FsAuthItemChildModel struct{ db *gorm.DB }
|
type FsAuthItemChildModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
func NewFsAuthItemChildModel(db *gorm.DB) *FsAuthItemChildModel { return &FsAuthItemChildModel{db} }
|
func NewFsAuthItemChildModel(db *gorm.DB) *FsAuthItemChildModel {
|
||||||
|
return &FsAuthItemChildModel{db: db, name: "fs_auth_item_child"}
|
||||||
|
}
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
package gmodel
|
package gmodel
|
||||||
// TODO: 使用model的属性做你想做的
|
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
|
@ -15,6 +15,11 @@ type FsAuthItem struct {
|
|||||||
UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` //
|
UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` //
|
||||||
// FsAuthItemIbfk1 foreign `gorm:"" json:"fs_auth_item_ibfk_1"`//
|
// FsAuthItemIbfk1 foreign `gorm:"" json:"fs_auth_item_ibfk_1"`//
|
||||||
}
|
}
|
||||||
type FsAuthItemModel struct{ db *gorm.DB }
|
type FsAuthItemModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
func NewFsAuthItemModel(db *gorm.DB) *FsAuthItemModel { return &FsAuthItemModel{db} }
|
func NewFsAuthItemModel(db *gorm.DB) *FsAuthItemModel {
|
||||||
|
return &FsAuthItemModel{db: db, name: "fs_auth_item"}
|
||||||
|
}
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
package gmodel
|
package gmodel
|
||||||
// TODO: 使用model的属性做你想做的
|
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
|
@ -11,6 +11,11 @@ type FsAuthRule struct {
|
|||||||
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` //
|
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` //
|
||||||
UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` //
|
UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` //
|
||||||
}
|
}
|
||||||
type FsAuthRuleModel struct{ db *gorm.DB }
|
type FsAuthRuleModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
func NewFsAuthRuleModel(db *gorm.DB) *FsAuthRuleModel { return &FsAuthRuleModel{db} }
|
func NewFsAuthRuleModel(db *gorm.DB) *FsAuthRuleModel {
|
||||||
|
return &FsAuthRuleModel{db: db, name: "fs_auth_rule"}
|
||||||
|
}
|
||||||
|
@ -1,2 +1,3 @@
|
|||||||
package gmodel
|
package gmodel
|
||||||
// TODO: 使用model的属性做你想做的
|
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
|
29
model/gmodel/fs_backend_user_gen.go
Normal file
29
model/gmodel/fs_backend_user_gen.go
Normal file
@ -0,0 +1,29 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gorm.io/gorm"
|
||||||
|
)
|
||||||
|
|
||||||
|
// fs_backend_user 管理员表
|
||||||
|
type FsBackendUser struct {
|
||||||
|
Id int64 `gorm:"primary_key;default:0;auto_increment;" json:"id"` // ID
|
||||||
|
Username *string `gorm:"unique_key;default:'';" json:"username"` // 用户名
|
||||||
|
AuthKey *string `gorm:"default:'';" json:"auth_key"` // jwt token
|
||||||
|
PasswordHash *string `gorm:"default:'';" json:"password_hash"` // 加密密码
|
||||||
|
PasswordResetToken *string `gorm:"default:'';" json:"password_reset_token"` //
|
||||||
|
Email *string `gorm:"unique_key;default:'';" json:"email"` // 邮箱
|
||||||
|
Status *int64 `gorm:"default:1;" json:"status"` // 状态
|
||||||
|
Icon *string `gorm:"default:'';" json:"icon"` //
|
||||||
|
DepartmentId *int64 `gorm:"default:0;" json:"department_id"` // 部门id
|
||||||
|
Permission *string `gorm:"default:'';" json:"permission"` // 权限设置
|
||||||
|
CreatedAt *int64 `gorm:"default:0;" json:"created_at"` // 创建时间
|
||||||
|
UpdatedAt *int64 `gorm:"default:0;" json:"updated_at"` // 更新时间
|
||||||
|
}
|
||||||
|
type FsBackendUserModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewFsBackendUserModel(db *gorm.DB) *FsBackendUserModel {
|
||||||
|
return &FsBackendUserModel{db: db, name: "fs_backend_user"}
|
||||||
|
}
|
15
model/gmodel/fs_backend_user_logic.go
Normal file
15
model/gmodel/fs_backend_user_logic.go
Normal file
@ -0,0 +1,15 @@
|
|||||||
|
package gmodel
|
||||||
|
|
||||||
|
import "context"
|
||||||
|
|
||||||
|
// TODO: 使用model的属性做你想做的
|
||||||
|
|
||||||
|
func (u *FsBackendUserModel) FindUserByEmail(ctx context.Context, emailname string) (resp FsBackendUser, err error) {
|
||||||
|
err = u.db.WithContext(ctx).Model(&resp).Where("`email` = ?", emailname).Take(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
|
||||||
|
func (u *FsBackendUserModel) FindUserById(ctx context.Context, Id int64) (resp FsBackendUser, err error) {
|
||||||
|
err = u.db.WithContext(ctx).Model(&resp).Where("`id` = ? and status != ?", Id, 0).Take(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
@ -15,6 +15,11 @@ type FsCanteenProduct struct {
|
|||||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||||
Sid *string `gorm:"default:'';" json:"sid"` // 前端带入的id
|
Sid *string `gorm:"default:'';" json:"sid"` // 前端带入的id
|
||||||
}
|
}
|
||||||
type FsCanteenProductModel struct{ db *gorm.DB }
|
type FsCanteenProductModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
func NewFsCanteenProductModel(db *gorm.DB) *FsCanteenProductModel { return &FsCanteenProductModel{db} }
|
func NewFsCanteenProductModel(db *gorm.DB) *FsCanteenProductModel {
|
||||||
|
return &FsCanteenProductModel{db: db, name: "fs_canteen_product"}
|
||||||
|
}
|
||||||
|
@ -11,6 +11,7 @@ func (c *FsCanteenProductModel) GetAllByCanteenTypeId(ctx context.Context, typeI
|
|||||||
}
|
}
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
func (c *FsCanteenProductModel) UpdateById(ctx context.Context, id int64, data *FsCanteenProduct) error {
|
func (c *FsCanteenProductModel) UpdateById(ctx context.Context, id int64, data *FsCanteenProduct) error {
|
||||||
return c.db.WithContext(ctx).Model(&FsCanteenProduct{}).Where("`id` = ? ", id).Updates(&data).Error
|
return c.db.WithContext(ctx).Model(&FsCanteenProduct{}).Where("`id` = ? ", id).Updates(&data).Error
|
||||||
}
|
}
|
||||||
@ -23,3 +24,8 @@ func (c *FsCanteenProductModel) UpdateByIdArr(ctx context.Context, ids []int64,
|
|||||||
func (c *FsCanteenProductModel) Create(ctx context.Context, data *FsCanteenProduct) error {
|
func (c *FsCanteenProductModel) Create(ctx context.Context, data *FsCanteenProduct) error {
|
||||||
return c.db.WithContext(ctx).Model(&FsCanteenProduct{}).Create(data).Error
|
return c.db.WithContext(ctx).Model(&FsCanteenProduct{}).Create(data).Error
|
||||||
}
|
}
|
||||||
|
|
||||||
|
func (c *FsCanteenProductModel) GetAllByCanteenTypeIdOrderAsc(ctx context.Context, typeId int64) (resp []FsCanteenProduct, err error) {
|
||||||
|
err = c.db.WithContext(ctx).Model(&FsCanteenProduct{}).Where("`canteen_type` = ? and `status` = ?", typeId, 1).Order("sort asc").Find(&resp).Error
|
||||||
|
return resp, err
|
||||||
|
}
|
||||||
|
@ -12,6 +12,11 @@ type FsCanteenType struct {
|
|||||||
Status *int64 `gorm:"default:0;" json:"status"` // 状态位 1启用0停用
|
Status *int64 `gorm:"default:0;" json:"status"` // 状态位 1启用0停用
|
||||||
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
Ctime *int64 `gorm:"default:0;" json:"ctime"` // 添加时间
|
||||||
}
|
}
|
||||||
type FsCanteenTypeModel struct{ db *gorm.DB }
|
type FsCanteenTypeModel struct {
|
||||||
|
db *gorm.DB
|
||||||
|
name string
|
||||||
|
}
|
||||||
|
|
||||||
func NewFsCanteenTypeModel(db *gorm.DB) *FsCanteenTypeModel { return &FsCanteenTypeModel{db} }
|
func NewFsCanteenTypeModel(db *gorm.DB) *FsCanteenTypeModel {
|
||||||
|
return &FsCanteenTypeModel{db: db, name: "fs_canteen_type"}
|
||||||
|
}
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user