Create & Init Project...

This commit is contained in:
2019-04-22 18:49:16 +08:00
commit fc4fa37393
25440 changed files with 4054998 additions and 0 deletions

View File

@@ -0,0 +1,68 @@
package(default_visibility = ["//visibility:public"])
load(
"@io_bazel_rules_go//go:def.bzl",
"go_test",
"go_library",
)
go_test(
name = "go_default_test",
srcs = ["regular_test.go"],
embed = [":go_default_library"],
tags = ["automanaged"],
deps = ["//vendor/github.com/smartystreets/goconvey/convey:go_default_library"],
)
go_library(
name = "go_default_library",
srcs = [
"app_info.go",
"card.go",
"coupon.go",
"enum.go",
"geetest.go",
"http.go",
"invite.go",
"model.go",
"notice.go",
"pendant.go",
"realname.go",
"regular.go",
"relation.go",
"reply.go",
"usersuit.go",
"vip.go",
"vip_outer.go",
"vip_welfare.go",
"web_info.go",
],
importpath = "go-common/app/interface/main/account/model",
tags = ["automanaged"],
visibility = ["//visibility:public"],
deps = [
"//app/service/main/account/api:go_default_library",
"//app/service/main/account/model:go_default_library",
"//app/service/main/coupon/model:go_default_library",
"//app/service/main/relation/model:go_default_library",
"//app/service/main/usersuit/model:go_default_library",
"//app/service/main/vip/api:go_default_library",
"//app/service/main/vip/model:go_default_library",
"//library/net/http/blademaster:go_default_library",
"//library/time:go_default_library",
],
)
filegroup(
name = "package-srcs",
srcs = glob(["**"]),
tags = ["automanaged"],
visibility = ["//visibility:private"],
)
filegroup(
name = "all-srcs",
srcs = [":package-srcs"],
tags = ["automanaged"],
visibility = ["//visibility:public"],
)

View File

@@ -0,0 +1,59 @@
package model
import xtime "go-common/library/time"
// const .
const (
UpNameLogID = 14
UpNameAction = "log_name_update"
)
// Account account.
type Account struct {
Mid int64 `json:"mid"`
Uname string `json:"uname"`
Face string `json:"face"`
Sex int8 `json:"sex"`
Birthday string `json:"birthday"`
Sign string `json:"sign"`
NickFree bool `json:"nick_free"`
}
// NickFree nickFree.
type NickFree struct {
NickFree bool `json:"nick_free"`
}
// PassportProfile is
/*
"mid": 288840748,
"uname": "小学生pasami",
"userid": "bili_43796499903",
"telphone": "9028005779",
"nickLock": 0,
"bind_qq": false,
"bind_sina": true,
"spacesta": 2,
"login_time": 1529165291,
"login_ip": "103.228.109.204",
"join_ip": "119.135.161.112",
"join_time": 1518286685,
"safe_question": 0,
"country_code": 1
*/
type PassportProfile struct {
Mid int64 `json:"mid"`
UName string `json:"uname"`
UserID string `json:"user_id"`
Telphone string `json:"telphone"`
NickLock int `json:"nick_lock"`
BindQQ bool `json:"bind_qq"`
BindSina bool `json:"bind_sina"`
SpaceSta int `json:"spacesta"`
LoginTime xtime.Time `json:"login_time"`
LoginIP string `json:"login_ip"`
JoinIP string `json:"join_ip"`
JoinTime xtime.Time `json:"join_time"`
SafeQuestion int `json:"safe_question"`
CountryCode int64 `json:"country_code"`
}

View File

@@ -0,0 +1,11 @@
package model
// ArgCardID arg card id.
type ArgCardID struct {
ID int64 `form:"id" validate:"required,min=1,gte=1"`
}
// ArgGroupID arg group id.
type ArgGroupID struct {
ID int64 `form:"id" validate:"required,min=1,gte=1"`
}

View File

@@ -0,0 +1,18 @@
package model
// ArgAllowanceList req.
type ArgAllowanceList struct {
State int8 `form:"state"`
}
// ArgCouponPage req .
type ArgCouponPage struct {
State int8 `form:"state"`
Pn int `form:"pn"`
Ps int `form:"ps"`
}
// ArgPrizeDraw struct .
type ArgPrizeDraw struct {
CardType int8 `form:"card_type" validate:"min=0,gte=0,lte=2"`
}

View File

@@ -0,0 +1,530 @@
package model
//Type type.
type Type struct {
ID int64 `json:"id"`
Type string `json:"type"`
}
// Origin coin origin
var Origin = map[int64]string{
1: "举报奖励",
2: "违规惩罚",
3: "撤销奖励",
4: "撤销惩罚",
5: "自动恢复",
6: "管理员操作",
}
// var .
var (
unmarried = &Type{1, "未婚"}
married = &Type{2, "已婚"}
divorce = &Type{3, "离异"}
widowed = &Type{4, "丧偶"}
Maritals = map[int]*Type{
1: unmarried,
2: married,
3: divorce,
4: widowed,
}
netFriend = &Type{1, "网友"}
lover = &Type{2, "恋人"}
playmate = &Type{3, "玩伴"}
commonInterest = &Type{3, "共同兴趣"}
boyFriend = &Type{5, "男性朋友"}
girFriend = &Type{6, "女性朋友"}
DatingTypes = map[int]*Type{
1: netFriend,
2: lover,
3: playmate,
4: commonInterest,
5: boyFriend,
6: girFriend,
}
Places = map[int]*Type{
500: {500, "北京市"},
501: {501, "西城区"},
502: {502, "崇文区"},
503: {503, "宣武区"},
504: {504, "朝阳区"},
505: {505, "海淀区"},
506: {506, "丰台区"},
507: {507, "石景山区"},
508: {508, "门头沟区"},
509: {509, "房山区"},
510: {510, "通州区"},
511: {511, "顺义区"},
512: {512, "昌平区"},
513: {513, "大兴区"},
514: {514, "平谷县"},
515: {515, "怀柔县"},
516: {516, "密云县"},
517: {517, "延庆县"},
518: {518, "东城区"},
1000: {1000, "上海市"},
1001: {1001, "黄浦区"},
1002: {1002, "卢湾区"},
1003: {1003, "徐汇区"},
1004: {1004, "长宁区"},
1005: {1005, "静安区"},
1006: {1006, "普陀区"},
1007: {1007, "闸北区"},
1008: {1008, "虹口区"},
1009: {1009, "杨浦区"},
1010: {1010, "宝山区"},
1011: {1011, "闵行区"},
1012: {1012, "嘉定区"},
1013: {1013, "浦东新区"},
1014: {1014, "松江区"},
1015: {1015, "金山区"},
1016: {1016, "青浦区"},
1017: {1017, "南汇区"},
1018: {1018, "奉贤区"},
1019: {1019, "崇明县"},
1500: {1500, "天津市"},
1501: {1501, "和平区"},
1502: {1502, "河东区"},
1503: {1503, "河西区"},
1504: {1504, "南开区"},
1505: {1505, "河北区"},
1506: {1506, "红桥区"},
1507: {1507, "塘沽区"},
1508: {1508, "汉沽区"},
1509: {1509, "大港区"},
1510: {1510, "东丽区"},
1511: {1511, "西青区"},
1512: {1512, "北辰区"},
1513: {1513, "津南区"},
1514: {1514, "武清区"},
1515: {1515, "宝坻区"},
1516: {1516, "静海县"},
1517: {1517, "宁河县"},
1518: {1518, "蓟县"},
2000: {2000, "重庆市"},
2001: {2001, "渝中区"},
2002: {2002, "大渡口区"},
2003: {2003, "江北区"},
2004: {2004, "沙坪坝区"},
2005: {2005, "九龙坡区"},
2006: {2006, "南岸区"},
2007: {2007, "北碚区"},
2008: {2008, "万盛区"},
2009: {2009, "双桥区"},
2010: {2010, "渝北区"},
2011: {2011, "巴南区"},
2012: {2012, "万州区"},
2013: {2013, "涪陵区"},
2014: {2014, "黔江区"},
2015: {2015, "永川市"},
2016: {2016, "合川市"},
2017: {2017, "江津市"},
2018: {2018, "南川市"},
2019: {2019, "长寿县"},
2020: {2020, "綦江县"},
2021: {2021, "潼南县"},
2022: {2022, "荣昌县"},
2023: {2023, "璧山县"},
2024: {2024, "大足县"},
2025: {2025, "铜梁县"},
2026: {2026, "梁平县"},
2027: {2027, "城口县"},
2028: {2028, "垫江县"},
2029: {2029, "武隆县"},
2030: {2030, "丰都县"},
2031: {2031, "奉节县"},
2032: {2032, "开县"},
2033: {2033, "云阳县"},
2034: {2034, "忠县"},
2035: {2035, "巫溪县"},
2036: {2036, "巫山县"},
2037: {2037, "石柱县"},
2038: {2038, "秀山县"},
2039: {2039, "酉阳县"},
2040: {2040, "彭水县"},
2500: {2500, "广东省"},
2501: {2501, "广州市"},
2502: {2502, "深圳市"},
2503: {2503, "珠海市"},
2504: {2504, "汕头市"},
2505: {2505, "韶关市"},
2506: {2506, "河源市"},
2507: {2507, "梅州市"},
2508: {2508, "惠州市"},
2509: {2509, "汕尾市"},
2510: {2510, "东莞市"},
2511: {2511, "中山市"},
2512: {2512, "江门市"},
2513: {2513, "佛山市"},
2514: {2514, "阳江市"},
2515: {2515, "湛江市"},
2516: {2516, "茂名市"},
2517: {2517, "肇庆市"},
2518: {2518, "清远市"},
2519: {2519, "潮州市"},
2520: {2520, "揭阳市"},
2521: {2521, "云浮市"},
3000: {3000, "福建省"},
3001: {3001, "福州市"},
3002: {3002, "厦门市"},
3003: {3003, "三明市"},
3004: {3004, "莆田市"},
3005: {3005, "泉州市"},
3006: {3006, "漳州市"},
3007: {3007, "南平市"},
3008: {3008, "龙岩市"},
3009: {3009, "宁德市"},
3500: {3500, "浙江省"},
3501: {3501, "杭州市"},
3502: {3502, "宁波市"},
3503: {3503, "温州市"},
3504: {3504, "嘉兴市"},
3505: {3505, "湖州市"},
3506: {3506, "绍兴市"},
3507: {3507, "金华市"},
3508: {3508, "衢州市"},
3509: {3509, "舟山市"},
3510: {3510, "台州市"},
3511: {3511, "丽水市"},
4000: {4000, "江苏省"},
4001: {4001, "南京市"},
4002: {4002, "徐州市"},
4003: {4003, "连云港市"},
4004: {4004, "淮安市"},
4005: {4005, "宿迁市"},
4006: {4006, "盐城市"},
4007: {4007, "扬州市"},
4008: {4008, "泰州市"},
4009: {4009, "南通市"},
4010: {4010, "镇江市"},
4011: {4011, "常州市"},
4012: {4012, "无锡市"},
4013: {4013, "苏州市"},
4500: {4500, "山东省"},
4501: {4501, "济南市"},
4502: {4502, "青岛市"},
4503: {4503, "淄博市"},
4504: {4504, "枣庄市"},
4505: {4505, "东营市"},
4506: {4506, "潍坊市"},
4507: {4507, "烟台市"},
4508: {4508, "威海市"},
4509: {4509, "济宁市"},
4510: {4510, "泰安市"},
4511: {4511, "日照市"},
4512: {4512, "莱芜市"},
4513: {4513, "德州市"},
4514: {4514, "临沂市"},
4515: {4515, "聊城市"},
4516: {4516, "滨州市"},
4517: {4517, "菏泽市"},
5000: {5000, "辽宁省"},
5001: {5001, "沈阳市"},
5002: {5002, "大连市"},
5003: {5003, "鞍山市"},
5004: {5004, "抚顺市"},
5005: {5005, "本溪市"},
5006: {5006, "丹东市"},
5007: {5007, "锦州市"},
5008: {5008, "葫芦岛市"},
5009: {5009, "营口市"},
5010: {5010, "盘锦市"},
5011: {5011, "阜新市"},
5012: {5012, "辽阳市"},
5013: {5013, "铁岭市"},
5014: {5014, "朝阳市"},
5500: {5500, "江西省"},
5501: {5501, "南昌市"},
5502: {5502, "景德镇市"},
5503: {5503, "萍乡市"},
5504: {5504, "新余市"},
5505: {5505, "九江市"},
5506: {5506, "鹰潭市"},
5507: {5507, "赣州市"},
5508: {5508, "吉安市"},
5509: {5509, "宜春市"},
5510: {5510, "抚州市"},
5511: {5511, "上饶市"},
6000: {6000, "四川省"},
6001: {6001, "成都市"},
6002: {6002, "自贡市"},
6003: {6003, "攀枝花市"},
6004: {6004, "泸州市"},
6005: {6005, "德阳市"},
6006: {6006, "绵阳市"},
6007: {6007, "广元市"},
6008: {6008, "遂宁市"},
6009: {6009, "内江市"},
6010: {6010, "乐山市"},
6011: {6011, "南充市"},
6012: {6012, "宜宾市"},
6013: {6013, "广安市"},
6014: {6014, "达州市"},
6015: {6015, "巴中市"},
6016: {6016, "雅安市"},
6017: {6017, "眉山市"},
6018: {6018, "资阳市"},
6019: {6019, "阿坝州"},
6020: {6020, "甘孜州"},
6021: {6021, "凉山州"},
6500: {6500, "陕西省"},
6501: {6501, "西安市"},
6502: {6502, "铜川市"},
6503: {6503, "宝鸡市"},
6504: {6504, "咸阳市"},
6505: {6505, "渭南市"},
6506: {6506, "延安市"},
6507: {6507, "汉中市"},
6508: {6508, "榆林市"},
6509: {6509, "安康市"},
6510: {6510, "商洛地区"},
7000: {7000, "湖北省"},
7001: {7001, "武汉市"},
7002: {7002, "黄石市"},
7003: {7003, "襄樊市"},
7004: {7004, "十堰市"},
7005: {7005, "荆州市"},
7006: {7006, "宜昌市"},
7007: {7007, "荆门市"},
7008: {7008, "鄂州市"},
7009: {7009, "孝感市"},
7010: {7010, "黄冈市"},
7011: {7011, "咸宁市"},
7012: {7012, "随州市"},
7013: {7013, "仙桃市"},
7014: {7014, "天门市"},
7015: {7015, "潜江市"},
7016: {7016, "神农架"},
7017: {7017, "恩施州"},
7500: {7500, "河南省"},
7501: {7501, "郑州市"},
7502: {7502, "开封市"},
7503: {7503, "洛阳市"},
7504: {7504, "平顶山市"},
7505: {7505, "焦作市"},
7506: {7506, "鹤壁市"},
7507: {7507, "新乡市"},
7508: {7508, "安阳市"},
7509: {7509, "濮阳市"},
7510: {7510, "许昌市"},
7511: {7511, "漯河市"},
7512: {7512, "三门峡市"},
7513: {7513, "南阳市"},
7514: {7514, "商丘市"},
7515: {7515, "信阳市"},
7516: {7516, "周口市"},
7517: {7517, "驻马店市"},
7518: {7518, "济源市"},
8000: {8000, "河北省"},
8001: {8001, "石家庄市"},
8002: {8002, "唐山市"},
8003: {8003, "秦皇岛市"},
8004: {8004, "邯郸市"},
8005: {8005, "邢台市"},
8006: {8006, "保定市"},
8007: {8007, "张家口市"},
8008: {8008, "承德市"},
8009: {8009, "沧州市"},
8010: {8010, "廊坊市"},
8011: {8011, "衡水市"},
8500: {8500, "山西省"},
8501: {8501, "太原市"},
8502: {8502, "大同市"},
8503: {8503, "阳泉市"},
8504: {8504, "长治市"},
8505: {8505, "晋城市"},
8506: {8506, "朔州市"},
8507: {8507, "晋中市"},
8508: {8508, "忻州市"},
8509: {8509, "临汾市"},
8510: {8510, "运城市"},
8511: {8511, "吕梁地区"},
9000: {9000, "内蒙古"},
9001: {9001, "呼和浩特"},
9002: {9002, "包头市"},
9003: {9003, "乌海市"},
9004: {9004, "赤峰市"},
9005: {9005, "通辽市"},
9006: {9006, "鄂尔多斯"},
9007: {9007, "乌兰察布"},
9008: {9008, "锡林郭勒"},
9009: {9009, "呼伦贝尔"},
9010: {9010, "巴彦淖尔"},
9011: {9011, "阿拉善盟"},
9012: {9012, "兴安盟"},
9500: {9500, "吉林省"},
9501: {9501, "长春市"},
9502: {9502, "吉林市"},
9503: {9503, "四平市"},
9504: {9504, "辽源市"},
9505: {9505, "通化市"},
9506: {9506, "白山市"},
9507: {9507, "松原市"},
9508: {9508, "白城市"},
9509: {9509, "延边州"},
10000: {10000, "黑龙江"},
10001: {10001, "哈尔滨市"},
10002: {10002, "齐齐哈尔"},
10003: {10003, "鹤岗市"},
10004: {10004, "双鸭山市"},
10005: {10005, "鸡西市"},
10006: {10006, "大庆市"},
10007: {10007, "伊春市"},
10008: {10008, "牡丹江市"},
10009: {10009, "佳木斯市"},
10010: {10010, "七台河市"},
10011: {10011, "黑河市"},
10012: {10012, "绥化市"},
10013: {10013, "大兴安岭"},
10500: {10500, "安徽省"},
10501: {10501, "合肥市"},
10502: {10502, "芜湖市"},
10503: {10503, "蚌埠市"},
10504: {10504, "淮南市"},
10505: {10505, "马鞍山市"},
10506: {10506, "淮北市"},
10507: {10507, "铜陵市"},
10508: {10508, "安庆市"},
10509: {10509, "黄山市"},
10510: {10510, "滁州市"},
10511: {10511, "阜阳市"},
10512: {10512, "宿州市"},
10513: {10513, "巢湖市"},
10514: {10514, "六安市"},
10515: {10515, "亳州市"},
10516: {10516, "宣城市"},
10517: {10517, "池州市"},
11000: {11000, "湖南省"},
11001: {11001, "长沙市"},
11002: {11002, "株州市"},
11003: {11003, "湘潭市"},
11004: {11004, "衡阳市"},
11005: {11005, "邵阳市"},
11006: {11006, "岳阳市"},
11007: {11007, "常德市"},
11008: {11008, "张家界市"},
11009: {11009, "益阳市"},
11010: {11010, "郴州市"},
11011: {11011, "永州市"},
11012: {11012, "怀化市"},
11013: {11013, "娄底市"},
11014: {11014, "湘西州"},
11500: {11500, "广西区"},
11501: {11501, "南宁市"},
11502: {11502, "柳州市"},
11503: {11503, "桂林市"},
11504: {11504, "梧州市"},
11505: {11505, "北海市"},
11506: {11506, "防城港市"},
11507: {11507, "钦州市"},
11508: {11508, "贵港市"},
11509: {11509, "玉林市"},
11510: {11510, "南宁地区"},
11511: {11511, "柳州地区"},
11512: {11512, "贺州地区"},
11513: {11513, "百色地区"},
11514: {11514, "河池地区"},
12000: {12000, "海南省"},
12001: {12001, "海口市"},
12002: {12002, "三亚市"},
12003: {12003, "五指山市"},
12004: {12004, "琼海市"},
12005: {12005, "儋州市"},
12006: {12006, "琼山市"},
12007: {12007, "文昌市"},
12008: {12008, "万宁市"},
12009: {12009, "东方市"},
12010: {12010, "澄迈县"},
12011: {12011, "定安县"},
12012: {12012, "屯昌县"},
12013: {12013, "临高县"},
12014: {12014, "白沙县"},
12015: {12015, "昌江县"},
12016: {12016, "乐东县"},
12017: {12017, "陵水县"},
12018: {12018, "保亭县"},
12019: {12019, "琼中县"},
12500: {12500, "云南省"},
12501: {12501, "昆明市"},
12502: {12502, "曲靖市"},
12503: {12503, "玉溪市"},
12504: {12504, "保山市"},
12505: {12505, "昭通市"},
12506: {12506, "思茅地区"},
12507: {12507, "临沧地区"},
12508: {12508, "丽江地区"},
12509: {12509, "文山州"},
12510: {12510, "红河州"},
12511: {12511, "西双版纳"},
12512: {12512, "楚雄州"},
12513: {12513, "大理州"},
12514: {12514, "德宏州"},
12515: {12515, "怒江州"},
12516: {12516, "迪庆州"},
13000: {13000, "贵州省"},
13001: {13001, "贵阳市"},
13002: {13002, "六盘水市"},
13003: {13003, "遵义市"},
13004: {13004, "安顺市"},
13005: {13005, "铜仁地区"},
13006: {13006, "毕节地区"},
13007: {13007, "黔西南州"},
13008: {13008, "黔东南州"},
13009: {13009, "黔南州"},
13500: {13500, "西藏区"},
13501: {13501, "拉萨市"},
13502: {13502, "那曲地区"},
13503: {13503, "昌都地区"},
13504: {13504, "山南地区"},
13505: {13505, "日喀则"},
13506: {13506, "阿里地区"},
13507: {13507, "林芝地区"},
14000: {14000, "甘肃省"},
14001: {14001, "兰州市"},
14002: {14002, "金昌市"},
14003: {14003, "白银市"},
14004: {14004, "天水市"},
14005: {14005, "嘉峪关市"},
14006: {14006, "武威市"},
14007: {14007, "定西地区"},
14008: {14008, "平凉地区"},
14009: {14009, "庆阳地区"},
14010: {14010, "陇南地区"},
14011: {14011, "张掖地区"},
14012: {14012, "酒泉地区"},
14013: {14013, "甘南州"},
14014: {14014, "临夏州"},
14500: {14500, "宁夏区"},
14501: {14501, "银川市"},
14502: {14502, "石嘴山市"},
14503: {14503, "吴忠市"},
14504: {14504, "固原市"},
15000: {15000, "青海省"},
15001: {15001, "西宁市"},
15002: {15002, "海东地区"},
15003: {15003, "海北州"},
15004: {15004, "黄南州"},
15005: {15005, "海南州"},
15006: {15006, "果洛州"},
15007: {15007, "玉树州"},
15008: {15008, "海西州"},
15500: {15500, "新疆区"},
15501: {15501, "乌鲁木齐"},
15502: {15502, "克拉玛依"},
15503: {15503, "石河子市"},
15504: {15504, "吐鲁番"},
15505: {15505, "哈密地区"},
15506: {15506, "和田地区"},
15507: {15507, "阿克苏"},
15508: {15508, "喀什地区"},
15509: {15509, "克孜勒苏"},
15510: {15510, "巴音郭楞"},
15511: {15511, "昌吉州"},
15512: {15512, "博尔塔拉"},
15513: {15513, "伊犁州"},
16000: {16000, "香港区"},
16500: {16500, "澳门区"},
17500: {17500, "台湾省"},
15514: {15514, "阿勒泰地区"},
}
)

View File

@@ -0,0 +1,45 @@
package model
const (
// MobileUserAgentFlag is
MobileUserAgentFlag = "Mobile"
// PlatH5 is
PlatH5 = "h5"
// PlatPC is
PlatPC = "pc"
)
// ProcessRes 请求获取极验验证响应参数
type ProcessRes struct {
Success int64 `json:"success"`
CaptchaID string `json:"gt"`
Challenge string `json:"challenge"`
NewCaptcha int `json:"new_captcha"`
}
//ValidateRes 验证返回值
type ValidateRes struct {
Seccode string `json:"seccode"`
}
// GeeCaptchaRequest 获取极验验证请求参数
type GeeCaptchaRequest struct {
MID int64 `json:"mid" form:"mid"`
IP string `json:"ip" form:"ip"`
// h5 web native
ClientType string `json:"client_type" form:"client_type" default:"web"`
}
// GeeCheckRequest 校验极验验证码请求参数
type GeeCheckRequest struct {
MID int64
Challenge string `json:"challenge" form:"challenge" validate:"required"`
Validate string `json:"validate" form:"validate" validate:"required"`
Seccode string `json:"seccode" form:"seccode" validate:"required"`
ClientType string `json:"client_type" form:"client_type" default:"web"`
}
// GeeCheckResponse 校验极验验证码响应参数
type GeeCheckResponse struct {
NewVoucher string `json:"new_voucher"`
}

View File

@@ -0,0 +1,50 @@
package model
// TokenResq .
type TokenResq struct {
CommonResq
Data *Token `json:"data"`
}
// Token .
type Token struct {
Token string `json:"token"`
URL string `json:"url"`
}
// CommonResq .
type CommonResq struct {
Code int64 `json:"code"`
TS int64 `json:"ts"`
Message string `json:"message"`
}
// ResourceCodeResq .
type ResourceCodeResq struct {
CommonResq
Data *ResourceCode `json:"data"`
}
// ResourceCode .
type ResourceCode struct {
Code string `json:"code"`
Status int8 `json:"status"`
Days int32 `json:"days"`
BatchCodeID int64 `json:"batch_code_id"`
}
// CMAccountInfo is
type CMAccountInfo struct {
Nickname string `json:"nickname"`
CertificationTitle string `json:"certification_title"`
CreditCode string `json:"credit_code"`
CompanyName string `json:"company_name"`
Organization string `json:"organization"`
OrganizationType string `json:"organization_type"`
}
// OfficialPermissionResponse is
type OfficialPermissionResponse struct {
DeniedRoles []int8 `json:"denied_roles"`
Metadata map[string]interface{} `json:"metadata"`
}

View File

@@ -0,0 +1,69 @@
package model
import (
"strconv"
accmdl "go-common/app/service/main/account/model"
usmdl "go-common/app/service/main/usersuit/model"
xtime "go-common/library/time"
)
// RichInviteStat rich invite stat.
type RichInviteStat struct {
Mid int64 `json:"mid"`
CurrentLimit int64 `json:"current_limit"`
CurrentBought int64 `json:"current_bought"`
TotalBought int64 `json:"total_bought"`
TotalUsed int64 `json:"total_used"`
InviteCodes []*RichInvite `json:"invite_codes"`
}
// RichInvite rich invite.
type RichInvite struct {
Status int64 `json:"status"`
Mid int64 `json:"mid"`
Code string `json:"invite_code"`
Ctime xtime.Time `json:"buy_time"`
Expires int64 `json:"expires"`
Invitee *Invitee `json:"invitee,omitempty"`
UsedAt int64 `json:"used_at,omitempty"`
}
// NewRichInvite new a rich invite.
func NewRichInvite(inv *usmdl.Invite, info *accmdl.Info) *RichInvite {
if inv == nil {
return nil
}
var invt *Invitee
if inv.Used() {
if info != nil {
invt = &Invitee{
Mid: inv.Imid,
Uname: info.Name,
Face: info.Face,
}
} else {
invt = &Invitee{
Mid: inv.Imid,
Uname: "用户" + strconv.FormatInt(inv.Imid, 10),
Face: "http://static.hdslb.com/images/member/noface.gif",
}
}
}
return &RichInvite{
Status: inv.Status,
Mid: inv.Mid,
Code: inv.Code,
Ctime: inv.Ctime,
Expires: inv.Expires,
Invitee: invt,
UsedAt: inv.UsedAt,
}
}
// Invitee invitee.
type Invitee struct {
Mid int64 `json:"mid"`
Uname string `json:"uname"`
Face string `json:"face"`
}

View File

@@ -0,0 +1,31 @@
package model
// IdentifyStatus .
type IdentifyStatus int8
// IdentifyStatus enum
const (
IdentifyNotOK IdentifyStatus = iota
IdentifyOK
// ApiIdentifyOk identify ok
APIIdentifyOk = 0
// ApiIdentifyNoInfo no identify info
APIIdentifyNoInfo = 1
)
// Identification .
type Identification struct {
Identification IdentifyStatus `json:"identification"`
}
// IdentifyInfo identify info.
type IdentifyInfo struct {
Identify int8 `json:"'identify'"`
Phone int8 `json:"phone"`
}
// IdentifyApply identify apply info.
type IdentifyApply struct {
Identify int8 `json:"'identify'"`
Applied bool `json:"applied"`
}

View File

@@ -0,0 +1,36 @@
package model
import (
"go-common/library/time"
)
const (
// NoticeStatusNotify notify
NoticeStatusNotify = 1
// NoticeStatusNotNotify not notify
NoticeStatusNotNotify = 0
// NoticeTypeSecurity security
NoticeTypeSecurity = "security"
)
// Notice2 v2.
type Notice2 struct {
Status int8 `json:"status"`
Type string `json:"type,omitempty"`
Realname *Realname `json:"realname,omitempty"`
Security *Security `json:"security,omitempty"`
}
// Realname struct.
type Realname struct {
Title string `json:"title,omitempty"`
URL string `json:"url,omitempty"`
}
// Security struct.
type Security struct {
Location string `json:"location,omitempty"`
Time time.Time `json:"time,omitempty"`
IP string `json:"ip,omitempty"`
Mid int64 `json:"mid,omitempty"`
}

View File

@@ -0,0 +1,83 @@
package model
import (
"strconv"
usmdl "go-common/app/service/main/usersuit/model"
)
// EquipPHP struct.
type EquipPHP struct {
Pid int64 `json:"pid"`
Coins float64 `json:"coins"`
Image string `json:"image"`
ImageModel string `json:"image_model"`
FaceURL string `json:"face_url"`
}
// GroupPHP php group result
type GroupPHP struct {
Name string `json:"group_name"`
Count int64 `json:"group_count"`
Pendant []*usmdl.Pendant `json:"pendant_info"`
}
// PendantPHP php pendant result
type PendantPHP struct {
Pid int64 `json:"pid"`
Name string `json:"name"`
Image string `json:"image"`
ImageModel string `json:"image_model"`
}
// GroupEntryPHP php vip pendant result
type GroupEntryPHP struct {
Pid int64 `json:"pid"`
Money int64 `json:"money"`
Name string `json:"name"`
Image string `json:"image"`
ImageModel string `json:"image_model"`
}
// GroupVipPHP php vip pendant result
type GroupVipPHP struct {
Pid int64 `json:"pid"`
Money int64 `json:"money"`
MoneyType int8 `json:"money_type"`
Expire int64 `json:"display_expire"`
Name string `json:"name"`
Image string `json:"image"`
ImageModel string `json:"image_model"`
}
// MyPHP struct.
type MyPHP struct {
Pid int64 `json:"pid"`
Name string `json:"name"`
MoneyType int8 `json:"money_type"`
Image string `json:"image"`
ImageModel string `json:"image_model"`
Expire int64 `json:"expire"`
IsActivated int8 `json:"is_activated"`
IsOnline int8 `json:"is_online"`
IsVip int8 `json:"is_vip"`
}
// MyHistoryPHP struct.
type MyHistoryPHP struct {
Pid int64 `json:"pid"`
Image string `json:"image"`
Name string `json:"name"`
BuyTime int64 `json:"buy_time"`
PayID string `json:"pay_id"`
Cost string `json:"cost"`
TimeLength int64 `json:"time_length"`
}
// FormatImgURL format images url
func FormatImgURL(mid int64, img string) (url string) {
if len(img) > 0 {
return "http://i" + strconv.FormatInt(mid%3, 10) + ".hdslb.com" + img
}
return
}

View File

@@ -0,0 +1,73 @@
package model
// RealnameBool is.
type RealnameBool uint8
// RealnameBool enum
const (
RealnameFalse RealnameBool = iota
RealnameTrue
)
// RealnameCountry .
type RealnameCountry struct {
ID int `json:"id"`
CName string `json:"cname"`
}
// RealnameCardType .
type RealnameCardType struct {
ID int `json:"id"`
Name string `json:"name"`
}
// RealnameChannel .
type RealnameChannel struct {
Name string
Flag RealnameBool
}
// ParamRealnameAlipayApply .
type ParamRealnameAlipayApply struct {
Realname string `form:"real_name"`
CardNum string `form:"card_num"`
Capture int `form:"capture"`
ImgToken string `form:"img_token"`
}
// RealnameAlipayApply .
type RealnameAlipayApply struct {
URL string `json:"url"`
// Bizno string `json:"biz_no"`
}
// RealnameAlipayConfirm .
type RealnameAlipayConfirm struct {
Passed RealnameBool `json:"passed"`
Reason string `json:"reason"`
}
// ParamRealnameCaptchaGTCheck .
type ParamRealnameCaptchaGTCheck struct {
Remote RealnameBool `form:"remote"`
Challenge string `form:"challenge"`
Validate string `form:"validate"`
Seccode string `form:"seccode"`
}
// ParamRealnameCaptchaGTRefresh .
type ParamRealnameCaptchaGTRefresh struct {
Hash string `form:"hash"`
}
// RealnameCaptchaGTRegister .
type RealnameCaptchaGTRegister struct {
Remote RealnameBool `json:"remote"`
ID string `json:"gt_id"`
Challenge string `json:"gt_challenge"`
}
// RealnameCaptchaGTValidate .
type RealnameCaptchaGTValidate struct {
State RealnameBool `json:"state"`
}

View File

@@ -0,0 +1,26 @@
package model
import (
"bytes"
"regexp"
)
// var .
var (
EmojiPattern = regexp.MustCompile(`[\x{1F600}-\x{1F6FF}|[\x{2600}-\x{26FF}]`)
NamePattern = regexp.MustCompile("^[A-Za-z0-9\uAC00-\uD788\u3041-\u309E\u30A1-\u30FE\u3131-\u3163\u4E00-\u9FA5\uF92C-\uFA29_\\-]+$")
)
// HasEmoji is used to check string is contain emoji
func HasEmoji(s string) bool {
return EmojiPattern.MatchString(s)
}
// ValidName check string is contain special characters.
func ValidName(s string) bool {
h := []byte(s)
if bytes.Contains(h, []byte("\xF0\x9F")) || bytes.Contains(h, []byte("\xC2\xA0")) {
return false
}
return NamePattern.MatchString(s) && !EmojiPattern.MatchString(s)
}

View File

@@ -0,0 +1,20 @@
package model
import (
"testing"
. "github.com/smartystreets/goconvey/convey"
)
func TestValidName(t *testing.T) {
Convey("ValidName", t, func() {
So(ValidName("FasdA0asd"+string(1)+"asdas"), ShouldBeFalse)
So(ValidName("FasdA0asd,asdas"), ShouldBeFalse)
So(ValidName("Fasd啊三0a😀asdas"), ShouldBeFalse)
So(ValidName("Fasd啊asdas"), ShouldBeFalse)
So(ValidName("Fasd啊\asdas"), ShouldBeFalse)
So(ValidName("Fasd啊-asdas_"), ShouldBeTrue)
So(ValidName("Fasd啊\xF0\x9Fasdas_"), ShouldBeFalse)
So(ValidName("Fasd啊xC2\xA0Fasdas_"), ShouldBeFalse)
})
}

View File

@@ -0,0 +1,223 @@
package model
import (
"strconv"
accountv1 "go-common/app/service/main/account/api"
relation "go-common/app/service/main/relation/model"
bm "go-common/library/net/http/blademaster"
)
// Vip .
type Vip struct {
Type int `json:"vipType"`
DueDate int64 `json:"vipDueDate"`
DueRemark string `json:"dueRemark"`
AccessStatus int `json:"accessStatus"`
VipStatus int `json:"vipStatus"`
VipStatusWarn string `json:"vipStatusWarn"`
}
// Following is user followinng info.
type Following struct {
*relation.Following
Uname string `json:"uname"`
Face string `json:"face"`
Sign string `json:"sign"`
// OfficialVerify member.OfficialInfo `json:"official_verify"`
OfficialVerify struct {
Type int8 `json:"type"`
Desc string `json:"desc"`
} `json:"official_verify"`
Vip Vip `json:"vip"`
}
// Tag is user info.
type Tag struct {
Mid int64 `json:"mid"`
Uname string `json:"uname"`
Face string `json:"face"`
Sign string `json:"sign"`
// OfficialVerify member.OfficialInfo `json:"official_verify"`
OfficialVerify struct {
Type int8 `json:"type"`
Desc string `json:"desc"`
} `json:"official_verify"`
Vip Vip `json:"vip"`
}
// Info struct.
type Info struct {
Mid string `json:"mid"`
Name string `json:"uname"`
Sex string `json:"sex"`
Sign string `json:"sign"`
Avatar string `json:"avatar"`
Rank string `json:"rank"`
DisplayRank string `json:"DisplayRank"`
LevelInfo struct {
Cur int `json:"current_level"`
Min int `json:"current_min"`
NowExp int `json:"current_exp"`
NextExp interface{} `json:"next_exp"`
} `json:"level_info"`
Pendant accountv1.PendantInfo `json:"pendant"`
Nameplate accountv1.NameplateInfo `json:"nameplate"`
OfficialVerify accountv1.OfficialInfo `json:"official_verify"`
Vip struct {
Type int `json:"vipType"`
DueDate int64 `json:"vipDueDate"`
DueRemark string `json:"dueRemark"`
AccessStatus int `json:"accessStatus"`
VipStatus int `json:"vipStatus"`
VipStatusWarn string `json:"vipStatusWarn"`
} `json:"vip"`
}
// RecommendInfo is
type RecommendInfo struct {
Info
RecommendContent
Fans int64 `json:"fans"`
TypeName string `json:"type_name"`
SecondTypeName string `json:"second_type_name"`
TrackID string `json:"track_id"`
Relation *relation.Following `json:"relation"`
}
// TagSuggestRecommendInfo is
type TagSuggestRecommendInfo struct {
TagName string `json:"tagname"`
UpList []*RecommendInfo `json:"up_list"`
MatchCnt int64 `json:"match_cnt"`
}
/*
{
"code": 0,
"trackid": "123",
"msg": "success",
"data": [
{
"up_id": 123,
"rec_reason": "游戏区热门up主",
"rec_type": 1,
"tid": 4,
"second_tid": 173
}
]
}
*/
// RecommendContent is
type RecommendContent struct {
UpID int64 `json:"up_id"`
RecReason string `json:"rec_reason"`
RecType int64 `json:"rec_type"`
Tid int16 `json:"tid"`
SecondTid int16 `json:"second_tid"`
}
// RecommendResponse is
type RecommendResponse struct {
Code int64 `json:"code"`
TrackID string `json:"trackid"`
Msg string `json:"msg"`
Data []*RecommendContent `json:"data"`
}
// TagSuggestRecommendContent is
type TagSuggestRecommendContent struct {
TagName string `json:"tagname"`
UpList []*RecommendContent `json:"up_list"`
MatchCnt int64 `json:"match_cnt"`
}
// UpIDs is
func (tsrc *TagSuggestRecommendContent) UpIDs() []int64 {
upIDs := make([]int64, 0, len(tsrc.UpList))
for _, up := range tsrc.UpList {
upIDs = append(upIDs, up.UpID)
}
return upIDs
}
// TagSuggestRecommendResponse is
type TagSuggestRecommendResponse struct {
Code int64 `json:"code"`
TrackID string `json:"trackid"`
Msg string `json:"msg"`
Data []*TagSuggestRecommendContent `json:"data"`
}
// FromCard from card.
func (i *Info) FromCard(c *accountv1.Card) {
i.Mid = strconv.FormatInt(c.Mid, 10)
i.Name = c.Name
i.Sex = c.Sex
i.Sign = c.Sign
i.Avatar = c.Face
i.Rank = strconv.FormatInt(int64(c.Rank), 10)
i.DisplayRank = "0"
i.LevelInfo.Cur = int(c.Level)
i.LevelInfo.NextExp = 0
// i.LevelInfo.Min =
i.Pendant = c.Pendant
i.Nameplate = c.Nameplate
i.OfficialVerify = c.Official
i.Vip.Type = int(c.Vip.Type)
i.Vip.VipStatus = int(c.Vip.Status)
i.Vip.DueDate = c.Vip.DueDate
}
// BatchModifyResult is
type BatchModifyResult struct {
FailedFids []int64 `json:"failed_fids"`
}
// ArgRecommend is
type ArgRecommend struct {
Mid int64
Device *bm.Device
RemoteIP string
MainTids string `form:"main_tids"`
SubTids string `form:"sub_tids"`
PageSize int64 `form:"pagesize" default:"10"`
}
// ArgTagSuggestRecommend is
type ArgTagSuggestRecommend struct {
Mid int64
Device *bm.Device
RemoteIP string
TagName string `form:"tagname"`
ContextID string `form:"context_id" validate:"required"`
PageSize int64 `form:"pagesize" default:"10"`
}
// ArgAchieveGet is
type ArgAchieveGet struct {
Mid int64
Award string `form:"award" validate:"required"`
}
// ArgAchieve is
type ArgAchieve struct {
AwardToken string `form:"award_token" validate:"required"`
}
// AchieveReply is
type AchieveReply struct {
relation.Achieve
Metadata map[string]interface{} `json:"metadata"`
}
// ArgSameFollowing is
type ArgSameFollowing struct {
Mid int64 `form:"mid"`
VMid int64 `form:"vmid" validate:"required"`
Order string `form:"order"`
PS int64 `form:"ps"`
PN int64 `form:"pn"`
ReVersion uint64 `form:"re_version"`
}

View File

@@ -0,0 +1,40 @@
package model
// ReplyHistory reply history
type ReplyHistory struct {
Page struct {
Num int `json:"num"`
Size int `json:"size"`
Total int `json:"total"`
} `json:"page"`
Records []*Record `json:"records"`
}
// Record record
type Record struct {
ID int `json:"id"`
Oid int64 `json:"oid"`
OidStr string `json:"oid_str"` // oid 前端会溢出改用 string
Type int64 `json:"type"`
Floor int `json:"floor"`
Like int `json:"like"`
Rcount int `json:"rcount"`
Mid int64 `json:"mid"`
State int `json:"state"`
Message string `json:"message"`
Ctime string `json:"ctime"`
Members []*Member `json:"members"`
RecordAppend
}
// RecordAppend record append
type RecordAppend struct {
Title string `json:"title"`
URL string `json:"url"`
}
// Member member
type Member struct {
Mid int64 `json:"mid"`
Uname string `json:"uname"`
}

View File

@@ -0,0 +1,19 @@
package model
// PendantInfo is.
type PendantInfo struct {
Pid int `json:"pid"`
Name string `json:"name"`
Image string `json:"image"`
Expire int `json:"expire"`
}
// NameplateInfo is.
type NameplateInfo struct {
Nid int `json:"nid"`
Name string `json:"name"`
Image string `json:"image"`
ImageSmall string `json:"image_small"`
Level string `json:"level"`
Condition string `json:"condition"`
}

View File

@@ -0,0 +1,310 @@
package model
import (
col "go-common/app/service/main/coupon/model"
vipv1 "go-common/app/service/main/vip/api"
vipmol "go-common/app/service/main/vip/model"
"go-common/library/time"
)
// vip tips.
const (
PanelPosition int8 = iota + 1
PgcPosition
)
const (
// PlatAndroid is int8 for android.
PlatAndroid = int8(0)
// PlatIPhone is int8 for iphone.
PlatIPhone = int8(1)
// PlatIPad is int8 for ipad.
PlatIPad = int8(2)
// PlatWPhone is int8 for wphone.
PlatWPhone = int8(3)
// PlatAndroidG is int8 for Android Googleplay.
PlatAndroidG = int8(4)
// PlatIPhoneI is int8 for Iphone Global.
PlatIPhoneI = int8(5)
// PlatIPadI is int8 for IPAD Global.
PlatIPadI = int8(6)
// PlatAndroidTV is int8 for AndroidTV Global.
PlatAndroidTV = int8(7)
// PlatAndroidI is int8 for Android Global.
PlatAndroidI = int8(8)
// PlatIpadHD is int8 for IpadHD
PlatIpadHD = int8(9)
// PlatAndroidB is int8 for Android Blue.
PlatAndroidB = int8(10)
// PlatIPhoneB is int8 for Android Blue.
PlatIPhoneB = int8(11)
)
// resource id .
const (
ResourceBannerIPhone = "2850"
ResourceBannerAndroid = "2857"
ResourceBannerIPad = "2864"
ResourceBuyIPhone = "2898"
ResourceBuyAndroid = "2903"
ResourceBuyIPad = "2908"
)
// IsAndroid check plat is android or ipad.
func IsAndroid(plat int8) bool {
return plat == PlatAndroid || plat == PlatAndroidG || plat == PlatAndroidI || plat == PlatAndroidB
}
// IsIOS check plat is iphone or ipad.
func IsIOS(plat int8) bool {
return plat == PlatIPad || plat == PlatIPhone || plat == PlatIPadI || plat == PlatIPhoneI
}
// IsIPhone check plat is iphone.
func IsIPhone(plat int8) bool {
return plat == PlatIPhone || plat == PlatIPhoneI
}
// IsIPad check plat is pad.
func IsIPad(plat int8) bool {
return plat == PlatIPad || plat == PlatIPadI || plat == PlatIpadHD
}
// IsIPhoneB check plat is iphone_b.
func IsIPhoneB(plat int8) bool {
return plat == PlatIPhoneB
}
// Plat .
func Plat(mobiApp, device string) int8 {
switch mobiApp {
case "iphone":
if device == "pad" {
return PlatIPad
}
return PlatIPhone
case "white":
return PlatIPhone
case "ipad":
return PlatIpadHD
case "android":
return PlatAndroid
case "win", "winphone":
return PlatWPhone
case "android_G":
return PlatAndroidG
case "android_i":
return PlatAndroidI
case "iphone_i":
if device == "pad" {
return PlatIPadI
}
return PlatIPhoneI
case "ipad_i":
return PlatIPadI
case "android_tv":
return PlatAndroidTV
case "android_b":
return PlatAndroidB
case "iphone_b":
return PlatIPhoneB
}
return PlatIPhone
}
// VIPInfo vip info.
type VIPInfo struct {
Mid int64 `json:"mid"`
Type int8 `json:"vipType"`
DueDate int64 `json:"vipDueDate"`
DueMsec int64 `json:"vipSurplusMsec"`
DueRemark string `json:"dueRemark"`
Status int8 `json:"accessStatus"`
VipStatus int8 `json:"vipStatus"`
}
// TipsReq tips request.
type TipsReq struct {
Version int64 `form:"build"`
Platform string `form:"platform" validate:"required"`
Position int8 `form:"position" default:"1"`
}
//CodeInfoReq code info request
type CodeInfoReq struct {
Appkey string `form:"appkey" validate:"required"`
Sign string `form:"sign"`
Ts time.Time `form:"ts"`
StartTime time.Time `form:"start_time" validate:"required"`
EndTime time.Time `form:"end_time" validate:"required"`
Cursor int64 `form:"cursor"`
}
// VipPanelRes .
type VipPanelRes struct {
Device string `form:"device"`
MobiApp string `form:"mobi_app"`
Platform string `form:"platform" default:"pc"`
SortTP int8 `form:"sort_type"`
PanelType string `form:"panel_type" default:"normal"`
Month int32 `form:"month"`
SubType int32 `form:"order_type"`
Build int64 `form:"build"`
}
// ArgVipCoupon req.
type ArgVipCoupon struct {
ID int64 `form:"id" validate:"required,min=1,gte=1"`
}
// ArgVipCancelPay req.
type ArgVipCancelPay struct {
CouponToken string `form:"coupon_token" validate:"required"`
}
// coupon cancel explain
const (
CouponCancelExplain = "解锁成功,请重新选择劵信息"
)
// const for vip
const (
MobiAppIphone = iota + 1
MobiAppIpad
MobiAppPC
MobiAppANDROID
)
//MobiAppByName .
var MobiAppByName = map[string]int{
"iphone": MobiAppIphone,
"ipad": MobiAppIpad,
"pc": MobiAppPC,
"android": MobiAppANDROID,
}
// MobiAppPlat .
func MobiAppPlat(mobiApp string) (p int) {
p = MobiAppByName[mobiApp]
if p == 0 {
// def pc.
p = MobiAppPC
}
return
}
// ArgVipPanel arg panel.
type ArgVipPanel struct {
Device string `form:"device"`
Build int64 `form:"build"`
MobiApp string `form:"mobi_app"`
Platform string `form:"platform" default:"pc"`
SortTP int8 `form:"sort_type"`
PanelType string `form:"panel_type" default:"normal"`
Mid int64
IP string
}
// VipPanelResp vip panel resp.
type VipPanelResp struct {
Vps []*vipmol.VipPanelInfo `json:"price_list"`
CodeSwitch int8 `json:"code_switch"`
GiveSwitch int8 `json:"give_switch"`
Privileges map[int8]*vipmol.PrivilegesResp `json:"privileges,omitempty"`
TipInfo *vipmol.TipsResp `json:"tip_info,omitempty"`
UserInfo *vipmol.VipPanelExplain `json:"user_info,omitempty"`
}
// VipPanelV8Resp vip panel v8 resp.
type VipPanelV8Resp struct {
Vps []*vipmol.VipPanelInfo `json:"price_list"`
CouponInfo *col.CouponAllowancePanelInfo `json:"coupon_info,omitempty"`
CouponSwith int8 `json:"coupon_switch,omitempty"`
CodeSwitch int8 `json:"code_switch"`
GiveSwitch int8 `json:"give_switch"`
Privileges map[int8]*vipmol.PrivilegesResp `json:"privileges,omitempty"`
TipInfo *vipmol.TipsResp `json:"tip_info,omitempty"`
UserInfo *vipmol.VipPanelExplain `json:"user_info,omitempty"`
AssociateVips []*vipmol.AssociateVipResp `json:"associate_vips,omitempty"`
}
// VipPanelRespV9 vip panel resp v9.
type VipPanelRespV9 struct {
Vps []*vipv1.ModelVipPanelInfo `json:"price_list,omitempty"`
Coupon *vipv1.CouponBySuitIDReply `json:"coupon,omitempty"`
CouponSwith int32 `json:"coupon_switch"`
CodeSwitch int32 `json:"code_switch"`
GiveSwitch int32 `json:"give_switch"`
Privileges map[int32]*vipv1.ModelPrivilegeResp `json:"privileges,omitempty"`
TipInfo *vipmol.TipsResp `json:"tip_info,omitempty"`
UserInfo *vipmol.VipPanelExplain `json:"user_info,omitempty"`
AssociateVips []*vipmol.AssociateVipResp `json:"associate_vips,omitempty"`
}
// ManagerResp manager resp.
type ManagerResp struct {
JointlyInfo []*vipmol.JointlyResp `json:"jointly_info"`
}
//ArgCreateOrder2 .
type ArgCreateOrder2 struct {
Month int32 `form:"months" validate:"required,min=1,gte=1"`
Platform string `form:"platform"`
MobiApp string `form:"mobi_app"`
Device string `form:"device"`
AppID int64 `form:"appId"`
AppSubID string `form:"appSubId"`
OrderType int8 `form:"orderType"`
Dtype int8 `form:"dtype"`
ReturnURL string `form:"returnUrl"`
CouponToken string `form:"coupon_token"`
Bmid int64 `form:"bmid"`
PanelType string `form:"panel_type" default:"normal"`
Build int64 `form:"build"`
IP string
Mid int64
}
//ArgCreateAssociateOrder create asoociate order .
type ArgCreateAssociateOrder struct {
Month int32 `form:"months" validate:"required,min=1,gte=1"`
Platform string `form:"platform" default:"pc"`
MobiApp string `form:"mobi_app"`
Device string `form:"device"`
AppID int64 `form:"appId"`
AppSubID string `form:"appSubId"`
OrderType int8 `form:"orderType"`
Dtype int8 `form:"dtype"`
ReturnURL string `form:"returnUrl"`
CouponToken string `form:"coupon_token"`
Bmid int64 `form:"bmid"`
PanelType string `form:"panel_type" default:"normal"`
Build int64 `form:"build"`
IP string
Mid int64
}
// ArgResource struct .
type ArgResource struct {
MID int64
ResIDs string
Plat int8 `form:"plat"`
Build int `form:"build" validate:"required"`
MobiApp string `form:"mobi_app" validate:"required"`
Device string `form:"device"`
Buvid string
IP string
Network string `form:"network"`
Channel string
}
// ArgCouponBySuitID coupon by suit id.
type ArgCouponBySuitID struct {
Mid int64
Sid int64 `form:"id" validate:"required,min=1,gte=1"`
Platform string `form:"platform" default:"pc"`
MobiApp string `form:"mobi_app"`
Device string `form:"device"`
PanelType string `form:"panel_type" default:"normal"`
Build int64 `form:"build"`
}

View File

@@ -0,0 +1,64 @@
package model
// ArgAuthCode get open_id args.
type ArgAuthCode struct {
Code string `form:"auth_code" validate:"required"`
APPID int64
IP string
}
// OpenIDResp open_id resp.
type OpenIDResp struct {
OpenID string `json:"open_id"`
}
// OAuth2InfoResp oauth2 resp.
type OAuth2InfoResp struct {
Mid int64 `json:"mid"`
Uname string `json:"uname"`
}
// ArgBind bind args.
type ArgBind struct {
OpenID string `form:"open_id" validate:"required"`
OutOpenID string `form:"out_open_id" validate:"required"`
AppID int64
}
// ArgUserInfoByOpenID args.
type ArgUserInfoByOpenID struct {
OpenID string `form:"open_id" validate:"required"`
AppID int64
IP string
}
// ArgBindInfo bind info args.
type ArgBindInfo struct {
Mid int64
AppID int64
}
// ArgBilibiliPrizeGrant args.
type ArgBilibiliPrizeGrant struct {
PrizeKey string `form:"prize_key" validate:"required"`
UniqueNo string `form:"unique_no" validate:"required"`
OpenID string `form:"open_id" validate:"required"`
AppID int64
}
// ArgBilibiliVipGrant bilibili vip grant args.
type ArgBilibiliVipGrant struct {
OpenID string `form:"open_id" validate:"required"`
OutOpenID string `form:"out_open_id" validate:"required"`
OutOrderNO string `form:"out_order_no" validate:"required"`
Duration int32 `form:"duration" validate:"required"`
AppID int64
}
// ArgOpenAuthCallBack args.
type ArgOpenAuthCallBack struct {
ThirdCode string `form:"auth_code" validate:"required"`
State string `form:"state" validate:"required"`
Mid int64
AppID int64
}

View File

@@ -0,0 +1,26 @@
package model
import "go-common/library/time"
// WelfareRes welfare list info
type WelfareRes struct {
ID int `json:"id"`
Name string `json:"name"`
HomepageUri string `json:"homepage_uri"`
BackdropUri string `json:"backdrop_uri"`
Tid int `json:"tid"`
Rank int `json:"rank"`
}
// WelfareInfo welfare info
type WelfareInfo struct {
ID int `json:"id"`
Name string `json:"name"`
Desc string `json:"desc"`
HomepageUri string `json:"homepage_uri"`
BackdropUri string `json:"backdrop_uri"`
SurplusCount int `json:"surplus_count"`
Received bool `json:"received"`
Stime time.Time `json:"stime"`
Etime time.Time `json:"etime"`
}

View File

@@ -0,0 +1,150 @@
package model
// User user info
type User struct {
Mid int64 `json:"mid"`
Uname string `json:"uname"`
Userid string `json:"userid"`
Sign string `json:"sign"`
Birthday string `json:"birthday"`
Sex string `json:"sex"`
NickFree bool `json:"nick_free"`
}
// Settings settings
type Settings struct {
Uname string `json:"uname"`
Sign string `json:"sign"`
Sex string `json:"sex"`
Birthday string `json:"birthday"`
}
// LogCoins log money
type LogCoins struct {
List []*LogCoin `json:"list"`
Count int `json:"count"`
}
// Coin coin.
type Coin struct {
Money float64 `json:"money"`
}
// LogCoin money
type LogCoin struct {
Time string `json:"time"`
Delta float64 `json:"delta"`
Reason string `json:"reason"`
}
// LogMorals log moral
type LogMorals struct {
Moral int64 `json:"moral"`
List []*LogMoral `json:"list"`
Count int `json:"count"`
}
// LogMoral moral
type LogMoral struct {
Origin string `json:"origin"`
Delta float64 `json:"delta"`
Reason string `json:"reason"`
Time string `json:"time"`
}
// LogExps log exp
type LogExps struct {
List []*LogExp `json:"list"`
Count int `json:"count"`
}
// LogExp exp
type LogExp struct {
Delta float64 `json:"delta"`
Time string `json:"time"`
Reason string `json:"reason"`
}
// LogLogins log login
type LogLogins struct {
Count int `json:"count"`
List []*LogLogin `json:"list"`
}
// LogLogin logLogin
type LogLogin struct {
IP string `json:"ip"`
Time int64 `json:"time"`
TimeAt string `json:"time_at"`
Status bool `json:"status"`
Type int64 `json:"type"`
Geo string `json:"geo"`
}
// Reward exp reward.
type Reward struct {
Login bool `json:"login"`
Watch bool `json:"watch"`
Coin int64 `json:"coins"`
Share bool `json:"share"`
}
// OfficialApply .
type OfficialApply struct {
Role int8 `form:"role" validate:"min=0,max=6" json:"role"`
Name string `form:"name" validate:"required" json:"name"`
Title string `form:"title" validate:"required" json:"title"`
Desc string `form:"desc" json:"desc"`
Realname int8 `form:"realname" json:"realname"`
Operator string `form:"operator" json:"operator"`
Telephone string `form:"telephone" json:"telephone"`
TelVerifyCode int64 `form:"tel_verify_code" json:"tel_verify_code"`
Email string `form:"email" json:"email"`
Address string `form:"address" json:"address"`
Company string `form:"company" json:"company"`
CreditCode string `form:"credit_code" json:"credit_code"` // 社会信用代码
Organization string `form:"organization" json:"organization"` // 政府或组织名称
OrganizationType string `form:"organization_type" json:"organization_type"` // 组织或机构类型
BusinessLicense string `form:"business_license" json:"business_license"` // 企业营业执照
BusinessScale string `form:"business_scale" json:"business_scale"` // 企业规模
BusinessLevel string `form:"business_level" json:"business_level"` // 企业登记
BusinessAuth string `form:"business_auth" json:"business_auth"` // 企业授权函
Supplement string `form:"supplement" json:"supplement"` // 其他补充材料
Professional string `form:"professional" json:"professional"` // 专业资质
Identification string `form:"identification" json:"identification"` // 身份认证
OfficialSite string `form:"official_site" json:"official_site"` // 官方站点
RegisteredCapital string `form:"registered_capital" json:"registered_capital"` // 注册资本
}
// OfficialSubmittedTimes is
type OfficialSubmittedTimes struct {
Submitted int64 `json:"submitted"`
Remain int64 `json:"remain"`
}
// OfficialConditions is official conditions
type OfficialConditions struct {
IsFormal bool `json:"is_formal"`
BindTel bool `json:"bind_tel"`
Realname bool `json:"realname"`
FollowerCount bool `json:"follower_count"`
ArchiveCount bool `json:"archive_count"`
// ViewCount bool `json:"view_count"`
}
// ArgMobileVerify is.
type ArgMobileVerify struct {
Mobile string `form:"mobile" validate:"required"`
Country int64 `form:"country"`
}
// AllPass is
func (cons *OfficialConditions) AllPass() bool {
return cons.IsFormal &&
cons.BindTel &&
cons.Realname &&
cons.FollowerCount &&
cons.ArchiveCount // &&
// cons.ViewCount
}