Merge branch 'develop' of gitee.com:fusenpack/fusenapi into develop
This commit is contained in:
commit
b9e00a72d0
goctl_template/api
server
home-user-auth
internal
test
product/internal/config
server_api
|
@ -1,7 +1,7 @@
|
||||||
Name: {{.serviceName}}
|
Name: {{.serviceName}}
|
||||||
Host: {{.host}}
|
Host: {{.host}}
|
||||||
Port: {{.port}}
|
Port: {{.port}}
|
||||||
DataSource: ""
|
SourceMysql: ""
|
||||||
Auth:
|
Auth:
|
||||||
AccessSecret: fusen2023
|
AccessSecret: fusen2023
|
||||||
AccessExpire: 604800
|
AccessExpire: 604800
|
||||||
|
|
|
@ -42,12 +42,12 @@ func (l *UserBasicInfoLogic) UserBasicInfo(req *types.Request, userinfo *auth.Us
|
||||||
|
|
||||||
return resp.SetStatus(basic.CodeOK, types.DataUserBasicInfo{
|
return resp.SetStatus(basic.CodeOK, types.DataUserBasicInfo{
|
||||||
Type: *user.Type,
|
Type: *user.Type,
|
||||||
IsOrderStatusEmail: *user.IsOrderStatusEmail > 0,
|
IsOrderStatusEmail: *user.IsOrderStatusEmail,
|
||||||
IsEmailAdvertisement: *user.IsEmailAdvertisement > 0,
|
IsEmailAdvertisement: *user.IsEmailAdvertisement,
|
||||||
IsOrderStatusPhone: *user.IsOrderStatusPhone > 0,
|
IsOrderStatusPhone: *user.IsOrderStatusPhone,
|
||||||
IsPhoneAdvertisement: *user.IsPhoneAdvertisement > 0,
|
IsPhoneAdvertisement: *user.IsPhoneAdvertisement,
|
||||||
IsOpenRender: *user.IsOpenRender > 0,
|
IsOpenRender: *user.IsOpenRender,
|
||||||
IsLowRendering: *user.IsLowRendering > 0,
|
IsLowRendering: *user.IsLowRendering,
|
||||||
IsRemoveBg: *user.IsRemoveBg > 0,
|
IsRemoveBg: *user.IsRemoveBg,
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
|
@ -31,7 +31,7 @@ func (l *UserFontsLogic) UserFonts(req *types.Request, userinfo *auth.UserInfo)
|
||||||
data, err := gmodel.NewFsFontModel(l.svcCtx.MysqlConn).FindAllOrderSortByDesc(l.ctx)
|
data, err := gmodel.NewFsFontModel(l.svcCtx.MysqlConn).FindAllOrderSortByDesc(l.ctx)
|
||||||
if err != gorm.ErrRecordNotFound && err != nil {
|
if err != gorm.ErrRecordNotFound && err != nil {
|
||||||
logx.Error(err)
|
logx.Error(err)
|
||||||
return resp.SetStatus(basic.CodeOK, data)
|
return resp.SetStatus(basic.CodeOK)
|
||||||
}
|
}
|
||||||
return resp.SetStatus(basic.CodeOK)
|
return resp.SetStatus(basic.CodeOK, data)
|
||||||
}
|
}
|
||||||
|
|
|
@ -9,19 +9,19 @@ type Request struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequestBasicInfoForm struct {
|
type RequestBasicInfoForm struct {
|
||||||
FirstName string `form:"first_name,optional" db:"first_name"` // FirstName
|
FirstName string `json:"first_name"` // FirstName
|
||||||
LastName string `form:"last_name,optional" db:"last_name"` // LastName
|
LastName string `json:"last_name"` // LastName
|
||||||
Company string `form:"company,optional" db:"company"` // 公司名称
|
Company string `json:"company"` // 公司名称
|
||||||
Mobile string `form:"mobile,optional" db:"mobile"` // 手机号码
|
Mobile string `json:"mobile"` // 手机号码
|
||||||
Email string `form:"email" db:"email"` // 邮箱
|
Email string `json:"email"` // 邮箱
|
||||||
Type int64 `form:"type,optional" db:"type"` // 1正常 0不正常
|
Type int64 `json:"type"` // 1正常 0不正常
|
||||||
IsOrderStatusEmail int64 `form:"is_order_status_email,optional" db:"is_order_status_email"` // 订单状态改变时是否接收邮件
|
IsOrderStatusEmail int64 `json:"is_order_status_email"` // 订单状态改变时是否接收邮件
|
||||||
IsEmailAdvertisement int64 `form:"is_email_advertisement,optional" db:"is_email_advertisement"` // 是否接收邮件广告
|
IsEmailAdvertisement int64 `json:"is_email_advertisement"` // 是否接收邮件广告
|
||||||
IsOrderStatusPhone int64 `form:"is_order_status_phone,optional" db:"is_order_status_phone"` // 订单状态改变是是否接收电话
|
IsOrderStatusPhone int64 `json:"is_order_status_phone"` // 订单状态改变是是否接收电话
|
||||||
IsPhoneAdvertisement int64 `form:"is_phone_advertisement,optional" db:"is_phone_advertisement"` // 是否接收短信广告
|
IsPhoneAdvertisement int64 `json:"is_phone_advertisement"` // 是否接收短信广告
|
||||||
IsOpenRender int64 `form:"is_open_render,optional" db:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
IsOpenRender int64 `json:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
||||||
IsLowRendering int64 `form:"is_low_rendering,optional" db:"is_low_rendering"` // 是否开启低渲染模型渲染
|
IsLowRendering int64 `json:"is_low_rendering"` // 是否开启低渲染模型渲染
|
||||||
IsRemoveBg int64 `form:"is_remove_bg,optional" db:"is_remove_bg"` // 用户上传logo是否去除背景
|
IsRemoveBg int64 `json:"is_remove_bg"` // 用户上传logo是否去除背景
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequestUserLogin struct {
|
type RequestUserLogin struct {
|
||||||
|
@ -39,19 +39,19 @@ type DataGuest struct {
|
||||||
|
|
||||||
type DataUserBasicInfo struct {
|
type DataUserBasicInfo struct {
|
||||||
Type int64 `json:"type"` // 1普通餐厅 2连锁餐厅
|
Type int64 `json:"type"` // 1普通餐厅 2连锁餐厅
|
||||||
IsOrderStatusEmail bool `json:"is_order_status_email"` // 订单状态改变时是否接收邮件
|
IsOrderStatusEmail int64 `json:"is_order_status_email"` // 订单状态改变时是否接收邮件
|
||||||
IsEmailAdvertisement bool `json:"is_email_advertisement"` // 是否接收邮件广告
|
IsEmailAdvertisement int64 `json:"is_email_advertisement"` // 是否接收邮件广告
|
||||||
IsOrderStatusPhone bool `json:"is_order_status_phone"` // 订单状态改变是是否接收电话
|
IsOrderStatusPhone int64 `json:"is_order_status_phone"` // 订单状态改变是是否接收电话
|
||||||
IsPhoneAdvertisement bool `json:"is_phone_advertisement"` // 是否接收短信广告
|
IsPhoneAdvertisement int64 `json:"is_phone_advertisement"` // 是否接收短信广告
|
||||||
IsOpenRender bool `json:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
IsOpenRender int64 `json:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
||||||
IsThousandFace bool `json:"is_thousand_face"` // 是否已经存在千人千面(1:存在,0:不存在)
|
IsThousandFace int64 `json:"is_thousand_face"` // 是否已经存在千人千面(1:存在,0:不存在)
|
||||||
IsLowRendering bool `json:"is_low_rendering"` // 是否开启低渲染模型渲染
|
IsLowRendering int64 `json:"is_low_rendering"` // 是否开启低渲染模型渲染
|
||||||
IsRemoveBg bool `json:"is_remove_bg"` // 用户上传logo是否去除背景
|
IsRemoveBg int64 `json:"is_remove_bg"` // 用户上传logo是否去除背景
|
||||||
}
|
}
|
||||||
|
|
||||||
type DataGetType struct {
|
type DataGetType struct {
|
||||||
Id int64 `db:"id" json:"key"` // ID
|
Id int64 `json:"key"` // ID
|
||||||
Name string `db:"name" json:"name"` // 餐厅名字
|
Name string `json:"name"` // 餐厅名字
|
||||||
}
|
}
|
||||||
|
|
||||||
type KeyName struct {
|
type KeyName struct {
|
||||||
|
@ -77,18 +77,18 @@ type DataStatusConfig struct {
|
||||||
}
|
}
|
||||||
|
|
||||||
type DataAddressList struct {
|
type DataAddressList struct {
|
||||||
Id int64 `db:"id"`
|
Id int64 `json:"id"`
|
||||||
UserId int64 `db:"user_id"` // 用户ID
|
UserId int64 `json:"user_id"` // 用户ID
|
||||||
Name string `db:"name"` // 地址名称
|
Name string `json:"name"` // 地址名称
|
||||||
FirstName string `db:"first_name"` // FirstName
|
FirstName string `json:"first_name"` // FirstName
|
||||||
LastName string `db:"last_name"` // LastName
|
LastName string `json:"last_name"` // LastName
|
||||||
Mobile string `db:"mobile"` // 手机号码
|
Mobile string `json:"mobile"` // 手机号码
|
||||||
Street string `db:"street"` // 街道
|
Street string `json:"street"` // 街道
|
||||||
Suite string `db:"suite"` // 房号
|
Suite string `json:"suite"` // 房号
|
||||||
City string `db:"city"` // 城市
|
City string `json:"city"` // 城市
|
||||||
State string `db:"state"` // 州名
|
State string `json:"state"` // 州名
|
||||||
ZipCode string `db:"zip_code"` // 邮编
|
ZipCode string `json:"zip_code"` // 邮编
|
||||||
IsDefault int64 `db:"is_default"` // 1默认地址,0非默认地址
|
IsDefault int64 `json:"is_default"` // 1默认地址,0非默认地址
|
||||||
}
|
}
|
||||||
|
|
||||||
type Response struct {
|
type Response struct {
|
||||||
|
|
|
@ -9,6 +9,7 @@ import (
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestCaseUserFontsLogic(t *testing.T) {
|
func TestCaseUserFontsLogic(t *testing.T) {
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
var resp *requests.Response
|
var resp *requests.Response
|
||||||
var result gjson.Result
|
var result gjson.Result
|
||||||
|
@ -44,16 +45,23 @@ func TestCaseUserFontsLogic(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// 遍历每个元素,检查其 key 和 name 字段是否存在,并且值是否符合预期
|
// 遍历每个元素,检查其 key 和 name 字段是否存在,并且值是否符合预期
|
||||||
for i, item := range dataArray {
|
for _, item := range dataArray {
|
||||||
key := item.Get("key").Int()
|
// log.Println(item)
|
||||||
name := item.Get("name").String()
|
|
||||||
|
|
||||||
if key != int64(i+1) {
|
if !item.Get("id").Exists() {
|
||||||
t.Errorf("Unexpected key value at index %d: %d", i, key)
|
t.Error("id is not exists")
|
||||||
}
|
}
|
||||||
|
if !item.Get("title").Exists() {
|
||||||
if len(name) == 0 {
|
t.Error("title is not exists")
|
||||||
t.Errorf("Missing name value at index %d", i)
|
}
|
||||||
|
if !item.Get("linux_fontname").Exists() {
|
||||||
|
t.Error("linux_fontname is not exists")
|
||||||
|
}
|
||||||
|
if !item.Get("file_path").Exists() {
|
||||||
|
t.Error("file_path is not exists")
|
||||||
|
}
|
||||||
|
if !item.Get("sort").Exists() {
|
||||||
|
t.Error("sort is not exists")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
103
server/home-user-auth/test/usersavebasicinfologic_test.go
Normal file
103
server/home-user-auth/test/usersavebasicinfologic_test.go
Normal file
|
@ -0,0 +1,103 @@
|
||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/474420502/requests"
|
||||||
|
"github.com/tidwall/gjson"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCaseUserSaveBasicinfoLogic(t *testing.T) {
|
||||||
|
var err error
|
||||||
|
var resp *requests.Response
|
||||||
|
var result gjson.Result
|
||||||
|
|
||||||
|
// 获取 session,并携带 JWT token
|
||||||
|
ses := GetSesssionWithUserToken(t, gserver)
|
||||||
|
var tp *requests.Temporary
|
||||||
|
|
||||||
|
tp = ses.Get(fmt.Sprintf("http://%s:%d/user/basic-info", cnf.Host, cnf.Port))
|
||||||
|
resp, err = tp.TestInServer(gserver)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
req := types.RequestBasicInfoForm{}
|
||||||
|
|
||||||
|
// log.Println(resp.Json().Get("data"))
|
||||||
|
|
||||||
|
err = json.Unmarshal([]byte(resp.Json().Get("data").String()), &req)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
IsOrderStatusEmail := req.IsOrderStatusEmail
|
||||||
|
IsEmailAdvertisement := req.IsEmailAdvertisement
|
||||||
|
IsOrderStatusPhone := req.IsOrderStatusPhone
|
||||||
|
IsOpenRender := req.IsOpenRender
|
||||||
|
IsLowRendering := req.IsLowRendering
|
||||||
|
IsRemoveBg := req.IsRemoveBg
|
||||||
|
|
||||||
|
req.IsOrderStatusEmail = ^req.IsOrderStatusEmail + 2
|
||||||
|
req.IsEmailAdvertisement = ^req.IsEmailAdvertisement + 2
|
||||||
|
req.IsOrderStatusPhone = ^req.IsOrderStatusPhone + 2
|
||||||
|
req.IsOpenRender = ^req.IsOpenRender + 2
|
||||||
|
req.IsLowRendering = ^req.IsLowRendering + 2
|
||||||
|
req.IsRemoveBg = ^req.IsRemoveBg + 2
|
||||||
|
|
||||||
|
// 向服务器发送 GET 请求,获取用户类型信息
|
||||||
|
tp = ses.Post(fmt.Sprintf("http://%s:%d/user/basic-info", cnf.Host, cnf.Port)).SetBodyJson(req)
|
||||||
|
resp, err = tp.TestInServer(gserver)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用 gjson 解析返回的 json 数据
|
||||||
|
result = gjson.Parse(resp.ContentString())
|
||||||
|
// log.Println(resp.ContentString())
|
||||||
|
// 检查返回值中的 code 字段是否存在,并且值是否为 200
|
||||||
|
code := result.Get("code").Int()
|
||||||
|
if code != 200 {
|
||||||
|
t.Errorf("Invalid code value: %d", code)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
tp = ses.Get(fmt.Sprintf("http://%s:%d/user/basic-info", cnf.Host, cnf.Port))
|
||||||
|
resp, err = tp.TestInServer(gserver)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
// log.Println(resp.ContentString())
|
||||||
|
err = json.Unmarshal([]byte(resp.Json().Get("data").String()), &req)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
|
if req.IsOrderStatusEmail != ^IsOrderStatusEmail+2 {
|
||||||
|
t.Error("IsOrderStatusEmail is error, check this code")
|
||||||
|
}
|
||||||
|
if req.IsEmailAdvertisement != ^IsEmailAdvertisement+2 {
|
||||||
|
t.Error("IsEmailAdvertisement is error, check this code")
|
||||||
|
}
|
||||||
|
if req.IsOrderStatusPhone != ^IsOrderStatusPhone+2 {
|
||||||
|
t.Error("IsOrderStatusPhone is error, check this code")
|
||||||
|
}
|
||||||
|
if req.IsOpenRender != ^IsOpenRender+2 {
|
||||||
|
t.Error("IsOpenRender is error, check this code")
|
||||||
|
}
|
||||||
|
if req.IsLowRendering != ^IsLowRendering+2 {
|
||||||
|
t.Error("IsLowRendering is error, check this code")
|
||||||
|
}
|
||||||
|
if req.IsRemoveBg != ^IsRemoveBg+2 {
|
||||||
|
t.Error("IsRemoveBg is error, check this code")
|
||||||
|
}
|
||||||
|
}
|
55
server/home-user-auth/test/userstatusconfiglogic_test.go
Normal file
55
server/home-user-auth/test/userstatusconfiglogic_test.go
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"fmt"
|
||||||
|
"testing"
|
||||||
|
|
||||||
|
"github.com/474420502/requests"
|
||||||
|
"github.com/tidwall/gjson"
|
||||||
|
)
|
||||||
|
|
||||||
|
func TestCaseUserStatusConfigLogic(t *testing.T) {
|
||||||
|
var err error
|
||||||
|
var resp *requests.Response
|
||||||
|
var result gjson.Result
|
||||||
|
|
||||||
|
// 获取 session,并携带 JWT token
|
||||||
|
ses := GetSesssionWithUserToken(t, gserver)
|
||||||
|
|
||||||
|
// 向服务器发送 GET 请求,获取用户类型信息
|
||||||
|
resp, err = ses.Post(fmt.Sprintf("http://%s:%d/user/status-config", cnf.Host, cnf.Port)).TestInServer(gserver)
|
||||||
|
if err != nil {
|
||||||
|
t.Error(err)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 使用 gjson 解析返回的 json 数据
|
||||||
|
result = gjson.Parse(resp.ContentString())
|
||||||
|
|
||||||
|
// 检查返回值中的 code 字段是否存在,并且值是否为 200
|
||||||
|
// 检查返回值中的 msg 字段是否存在,并且值是否为 "success"
|
||||||
|
msg := result.Get("msg").String()
|
||||||
|
if msg != "success" {
|
||||||
|
t.Errorf(`Invalid msg value: "%s"`, msg)
|
||||||
|
}
|
||||||
|
|
||||||
|
// 检查返回值中的 data 字段是否存在,并且值是否为数组类型
|
||||||
|
dataArray := result.Get("data.search_list").Array()
|
||||||
|
if len(dataArray) == 0 {
|
||||||
|
t.Error("Empty data field")
|
||||||
|
}
|
||||||
|
|
||||||
|
// 遍历每个元素,检查其 key 和 name 字段是否存在,并且值是否符合预期
|
||||||
|
for _, item := range dataArray {
|
||||||
|
|
||||||
|
key := item.Get("key")
|
||||||
|
name := item.Get("name")
|
||||||
|
|
||||||
|
if !key.Exists() {
|
||||||
|
t.Errorf("key is not exists")
|
||||||
|
}
|
||||||
|
|
||||||
|
if !name.Exists() {
|
||||||
|
t.Errorf("name is not exists")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -2,6 +2,7 @@ package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fusenapi/server/product/internal/types"
|
"fusenapi/server/product/internal/types"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/rest"
|
"github.com/zeromicro/go-zero/rest"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
|
@ -41,19 +41,19 @@ service home-user-auth {
|
||||||
}
|
}
|
||||||
|
|
||||||
type RequestBasicInfoForm {
|
type RequestBasicInfoForm {
|
||||||
FirstName string `form:"first_name,optional" db:"first_name"` // FirstName
|
FirstName string `json:"first_name"` // FirstName
|
||||||
LastName string `form:"last_name,optional" db:"last_name"` // LastName
|
LastName string `json:"last_name"` // LastName
|
||||||
Company string `form:"company,optional" db:"company"` // 公司名称
|
Company string `json:"company"` // 公司名称
|
||||||
Mobile string `form:"mobile,optional" db:"mobile"` // 手机号码
|
Mobile string `json:"mobile"` // 手机号码
|
||||||
Email string `form:"email" db:"email"` // 邮箱
|
Email string `json:"email"` // 邮箱
|
||||||
Type int64 `form:"type,optional" db:"type"` // 1正常 0不正常
|
Type int64 `json:"type"` // 1正常 0不正常
|
||||||
IsOrderStatusEmail int64 `form:"is_order_status_email,optional" db:"is_order_status_email"` // 订单状态改变时是否接收邮件
|
IsOrderStatusEmail int64 `json:"is_order_status_email"` // 订单状态改变时是否接收邮件
|
||||||
IsEmailAdvertisement int64 `form:"is_email_advertisement,optional" db:"is_email_advertisement"` // 是否接收邮件广告
|
IsEmailAdvertisement int64 `json:"is_email_advertisement"` // 是否接收邮件广告
|
||||||
IsOrderStatusPhone int64 `form:"is_order_status_phone,optional" db:"is_order_status_phone"` // 订单状态改变是是否接收电话
|
IsOrderStatusPhone int64 `json:"is_order_status_phone"` // 订单状态改变是是否接收电话
|
||||||
IsPhoneAdvertisement int64 `form:"is_phone_advertisement,optional" db:"is_phone_advertisement"` // 是否接收短信广告
|
IsPhoneAdvertisement int64 `json:"is_phone_advertisement"` // 是否接收短信广告
|
||||||
IsOpenRender int64 `form:"is_open_render,optional" db:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
IsOpenRender int64 `json:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
||||||
IsLowRendering int64 `form:"is_low_rendering,optional" db:"is_low_rendering"` // 是否开启低渲染模型渲染
|
IsLowRendering int64 `json:"is_low_rendering"` // 是否开启低渲染模型渲染
|
||||||
IsRemoveBg int64 `form:"is_remove_bg,optional" db:"is_remove_bg"` // 用户上传logo是否去除背景
|
IsRemoveBg int64 `json:"is_remove_bg"` // 用户上传logo是否去除背景
|
||||||
|
|
||||||
// NewPassword string `form:"new_password,optional" db:"new_password"` // new_password 如果存在新密码
|
// NewPassword string `form:"new_password,optional" db:"new_password"` // new_password 如果存在新密码
|
||||||
}
|
}
|
||||||
|
@ -77,20 +77,20 @@ type DataGuest {
|
||||||
// UserBasicInfoHandler 返回data结构
|
// UserBasicInfoHandler 返回data结构
|
||||||
type DataUserBasicInfo {
|
type DataUserBasicInfo {
|
||||||
Type int64 `json:"type"` // 1普通餐厅 2连锁餐厅
|
Type int64 `json:"type"` // 1普通餐厅 2连锁餐厅
|
||||||
IsOrderStatusEmail bool `json:"is_order_status_email"` // 订单状态改变时是否接收邮件
|
IsOrderStatusEmail int64 `json:"is_order_status_email"` // 订单状态改变时是否接收邮件
|
||||||
IsEmailAdvertisement bool `json:"is_email_advertisement"` // 是否接收邮件广告
|
IsEmailAdvertisement int64 `json:"is_email_advertisement"` // 是否接收邮件广告
|
||||||
IsOrderStatusPhone bool `json:"is_order_status_phone"` // 订单状态改变是是否接收电话
|
IsOrderStatusPhone int64 `json:"is_order_status_phone"` // 订单状态改变是是否接收电话
|
||||||
IsPhoneAdvertisement bool `json:"is_phone_advertisement"` // 是否接收短信广告
|
IsPhoneAdvertisement int64 `json:"is_phone_advertisement"` // 是否接收短信广告
|
||||||
IsOpenRender bool `json:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
IsOpenRender int64 `json:"is_open_render"` // 是否打开个性化渲染(1:开启,0:关闭)
|
||||||
IsThousandFace bool `json:"is_thousand_face"` // 是否已经存在千人千面(1:存在,0:不存在)
|
IsThousandFace int64 `json:"is_thousand_face"` // 是否已经存在千人千面(1:存在,0:不存在)
|
||||||
IsLowRendering bool `json:"is_low_rendering"` // 是否开启低渲染模型渲染
|
IsLowRendering int64 `json:"is_low_rendering"` // 是否开启低渲染模型渲染
|
||||||
IsRemoveBg bool `json:"is_remove_bg"` // 用户上传logo是否去除背景
|
IsRemoveBg int64 `json:"is_remove_bg"` // 用户上传logo是否去除背景
|
||||||
}
|
}
|
||||||
|
|
||||||
// /user/get-type reponse.data 结构
|
// /user/get-type reponse.data 结构
|
||||||
type DataGetType {
|
type DataGetType {
|
||||||
Id int64 `db:"id" json:"key"` // ID
|
Id int64 `json:"key"` // ID
|
||||||
Name string `db:"name" json:"name"` // 餐厅名字
|
Name string `json:"name"` // 餐厅名字
|
||||||
}
|
}
|
||||||
|
|
||||||
// KeyName 普通的key name 对象结构. eg: /user/status-config 用在返回值
|
// KeyName 普通的key name 对象结构. eg: /user/status-config 用在返回值
|
||||||
|
@ -120,18 +120,18 @@ type DataStatusConfig {
|
||||||
|
|
||||||
// DataAddressList /user/address-list 返回值
|
// DataAddressList /user/address-list 返回值
|
||||||
type DataAddressList {
|
type DataAddressList {
|
||||||
Id int64 `db:"id"`
|
Id int64 `json:"id"`
|
||||||
UserId int64 `db:"user_id"` // 用户ID
|
UserId int64 `json:"user_id"` // 用户ID
|
||||||
Name string `db:"name"` // 地址名称
|
Name string `json:"name"` // 地址名称
|
||||||
FirstName string `db:"first_name"` // FirstName
|
FirstName string `json:"first_name"` // FirstName
|
||||||
LastName string `db:"last_name"` // LastName
|
LastName string `json:"last_name"` // LastName
|
||||||
Mobile string `db:"mobile"` // 手机号码
|
Mobile string `json:"mobile"` // 手机号码
|
||||||
Street string `db:"street"` // 街道
|
Street string `json:"street"` // 街道
|
||||||
Suite string `db:"suite"` // 房号
|
Suite string `json:"suite"` // 房号
|
||||||
City string `db:"city"` // 城市
|
City string `json:"city"` // 城市
|
||||||
State string `db:"state"` // 州名
|
State string `json:"state"` // 州名
|
||||||
// Country string `db:"country"` // 国家
|
// Country string `json:"country"` // 国家
|
||||||
ZipCode string `db:"zip_code"` // 邮编
|
ZipCode string `json:"zip_code"` // 邮编
|
||||||
// Status int64 `db:"status"` // 1正常 0异常
|
// Status int64 `json:"status"` // 1正常 0异常
|
||||||
IsDefault int64 `db:"is_default"` // 1默认地址,0非默认地址
|
IsDefault int64 `json:"is_default"` // 1默认地址,0非默认地址
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user