把server归到统一文件夹
This commit is contained in:
parent
dc73ff1679
commit
859c101c51
|
@ -1,2 +1,4 @@
|
||||||
#! /bin/bash
|
#! /bin/bash
|
||||||
goctl api go -api server_api/$1.api -dir $1 --home ./goctl_template/
|
name=${1%\/}
|
||||||
|
echo $name
|
||||||
|
goctl api go -api server_api/$name.api -dir server/$name --home ./goctl_template/
|
|
@ -1,31 +0,0 @@
|
||||||
package logic
|
|
||||||
|
|
||||||
import (
|
|
||||||
"context"
|
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
|
||||||
"fusenapi/home-user-auth/internal/types"
|
|
||||||
"fusenapi/utils/basic"
|
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
|
||||||
)
|
|
||||||
|
|
||||||
type UserStatusConfigLogic struct {
|
|
||||||
logx.Logger
|
|
||||||
ctx context.Context
|
|
||||||
svcCtx *svc.ServiceContext
|
|
||||||
}
|
|
||||||
|
|
||||||
func NewUserStatusConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserStatusConfigLogic {
|
|
||||||
return &UserStatusConfigLogic{
|
|
||||||
Logger: logx.WithContext(ctx),
|
|
||||||
ctx: ctx,
|
|
||||||
svcCtx: svcCtx,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
func (l *UserStatusConfigLogic) UserStatusConfig(req *types.RequestBasicInfoForm) (resp *types.Response) {
|
|
||||||
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
|
||||||
|
|
||||||
return resp.SetStatus(basic.CodeOK)
|
|
||||||
}
|
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"flag"
|
"flag"
|
||||||
"fmt"
|
"fmt"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/config"
|
"fusenapi/server/home-user-auth/internal/config"
|
||||||
"fusenapi/home-user-auth/internal/handler"
|
"fusenapi/server/home-user-auth/internal/handler"
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/conf"
|
"github.com/zeromicro/go-zero/core/conf"
|
||||||
"github.com/zeromicro/go-zero/rest"
|
"github.com/zeromicro/go-zero/rest"
|
|
@ -1,7 +1,7 @@
|
||||||
package config
|
package config
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fusenapi/home-user-auth/internal/types"
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/rest"
|
"github.com/zeromicro/go-zero/rest"
|
||||||
)
|
)
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/logic"
|
"fusenapi/server/home-user-auth/internal/logic"
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
"fusenapi/home-user-auth/internal/types"
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func GetTypeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func GetTypeHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
@ -4,7 +4,7 @@ package handler
|
||||||
import (
|
import (
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/rest"
|
"github.com/zeromicro/go-zero/rest"
|
||||||
)
|
)
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/logic"
|
"fusenapi/server/home-user-auth/internal/logic"
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
"fusenapi/home-user-auth/internal/types"
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func UserBasicInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func UserBasicInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/logic"
|
"fusenapi/server/home-user-auth/internal/logic"
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
"fusenapi/home-user-auth/internal/types"
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func UserFontsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func UserFontsHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
@ -8,9 +8,9 @@ import (
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/logic"
|
"fusenapi/server/home-user-auth/internal/logic"
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
"fusenapi/home-user-auth/internal/types"
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
)
|
)
|
||||||
|
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/logic"
|
"fusenapi/server/home-user-auth/internal/logic"
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
"fusenapi/home-user-auth/internal/types"
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func UserSaveBasicInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func UserSaveBasicInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
@ -7,9 +7,9 @@ import (
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
"github.com/zeromicro/go-zero/rest/httpx"
|
"github.com/zeromicro/go-zero/rest/httpx"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/logic"
|
"fusenapi/server/home-user-auth/internal/logic"
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
"fusenapi/home-user-auth/internal/types"
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
)
|
)
|
||||||
|
|
||||||
func UserStatusConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
func UserStatusConfigHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
|
|
@ -3,9 +3,9 @@ package logic
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
|
||||||
"fusenapi/home-user-auth/internal/types"
|
|
||||||
"fusenapi/model"
|
"fusenapi/model"
|
||||||
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
|
@ -2,9 +2,9 @@ package logic
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
|
||||||
"fusenapi/home-user-auth/internal/types"
|
|
||||||
"fusenapi/model"
|
"fusenapi/model"
|
||||||
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
"fusenapi/utils/auth"
|
"fusenapi/utils/auth"
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
|
|
|
@ -3,9 +3,9 @@ package logic
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
|
||||||
"fusenapi/home-user-auth/internal/types"
|
|
||||||
"fusenapi/model"
|
"fusenapi/model"
|
||||||
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
|
||||||
"fusenapi/home-user-auth/internal/types"
|
|
||||||
"fusenapi/model"
|
"fusenapi/model"
|
||||||
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
"github.com/golang-jwt/jwt"
|
"github.com/golang-jwt/jwt"
|
|
@ -4,9 +4,9 @@ import (
|
||||||
"context"
|
"context"
|
||||||
"fusenapi/utils/auth"
|
"fusenapi/utils/auth"
|
||||||
|
|
||||||
"fusenapi/home-user-auth/internal/svc"
|
|
||||||
"fusenapi/home-user-auth/internal/types"
|
|
||||||
"fusenapi/model"
|
"fusenapi/model"
|
||||||
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
"fusenapi/utils/basic"
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/logx"
|
"github.com/zeromicro/go-zero/core/logx"
|
|
@ -0,0 +1,92 @@
|
||||||
|
package logic
|
||||||
|
|
||||||
|
import (
|
||||||
|
"context"
|
||||||
|
|
||||||
|
"fusenapi/server/home-user-auth/internal/svc"
|
||||||
|
"fusenapi/server/home-user-auth/internal/types"
|
||||||
|
"fusenapi/utils/basic"
|
||||||
|
|
||||||
|
"github.com/zeromicro/go-zero/core/logx"
|
||||||
|
)
|
||||||
|
|
||||||
|
type UserStatusConfigLogic struct {
|
||||||
|
logx.Logger
|
||||||
|
ctx context.Context
|
||||||
|
svcCtx *svc.ServiceContext
|
||||||
|
}
|
||||||
|
|
||||||
|
func NewUserStatusConfigLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UserStatusConfigLogic {
|
||||||
|
return &UserStatusConfigLogic{
|
||||||
|
Logger: logx.WithContext(ctx),
|
||||||
|
ctx: ctx,
|
||||||
|
svcCtx: svcCtx,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
func (l *UserStatusConfigLogic) UserStatusConfig(req *types.RequestBasicInfoForm) (resp *types.Response) {
|
||||||
|
// 返回值必须调用Set重新返回, resp可以空指针调用 resp.SetStatus(basic.CodeOK, data)
|
||||||
|
|
||||||
|
return resp.SetStatus(basic.CodeOK)
|
||||||
|
}
|
||||||
|
|
||||||
|
// [
|
||||||
|
// //返回订单每个状态值
|
||||||
|
// //搜索下拉列表
|
||||||
|
// 'search_list' => [
|
||||||
|
// ['key' => -1, "name" => 'All'],
|
||||||
|
// ['key' => 1, "name" => 'Order Has Been Placed'],
|
||||||
|
// ['key' => 2, "name" => 'In Production'],
|
||||||
|
// ['key' => 3, "name" => 'Shipped'],
|
||||||
|
// ['key' => 4, "name" => 'Inventory'],
|
||||||
|
// ['key' => 8, "name" => 'Ready for Shipment'],
|
||||||
|
// ['key' => 5, "name" => 'Completed'],
|
||||||
|
// // ['key' => 6, "name" => 'Refund Under Review'],
|
||||||
|
// ['key' => 7, "name" => 'Transaction Closed'],
|
||||||
|
// ],
|
||||||
|
// //直邮单状态
|
||||||
|
// 'order_status' => [
|
||||||
|
// ['key' => 1, "name" => 'Order Has Been Placed', 'button' => ['download_invoice', 'cancel', 'again', 'toPay']],
|
||||||
|
// ['key' => 2, "name" => 'In Production', 'button' => ['download_invoice', 'again', 'toPay']],
|
||||||
|
// ['key' => 3, "name" => 'Shipped', 'button' => ['download_invoice', 'again', 'view_logistics']],
|
||||||
|
// ['key' => 5, "name" => 'Completed', 'button' => ['download_invoice', 'again', 'view_logistics', 'delete']],
|
||||||
|
// // ['key' => 6, "name" => 'Refund Under Review', 'button' => ['again', 'delete']],
|
||||||
|
// ['key' => 7, "name" => 'Transaction Closed', 'button' => ['again', 'delete']],
|
||||||
|
// ],
|
||||||
|
// //云仓单状态
|
||||||
|
// 'Inventory_status' => [
|
||||||
|
// ['key' => 1, "name" => 'Order Has Been Placed', 'button' => ['download_invoice', 'cancel', 'again', 'toPay']],
|
||||||
|
// ['key' => 2, "name" => 'In Production', 'button' => ['download_invoice', 'again', 'toPay']],
|
||||||
|
// ['key' => 4, "name" => 'Inventory', 'button' => ['download_invoice', 'again', 'go_cloud', 'toPay']],
|
||||||
|
// ['key' => 8, "name" => 'Ready for Shipment', 'button' => ['download_invoice', 'again', 'go_cloud', 'delete']],
|
||||||
|
// // ['key' => 6, "name" => 'Refund Under Review', 'button' => ['again', 'delete']],
|
||||||
|
// ['key' => 7, "name" => 'Transaction Closed', 'button' => ['again', 'delete']],
|
||||||
|
// ],
|
||||||
|
// //订单物流状态
|
||||||
|
// 'order_logistics_status' => Order::$statusFontLogisticOrder,
|
||||||
|
// //订单物流状态
|
||||||
|
// 'Inventory_logistics_status' => Order::$statusFontLogisticInventory,
|
||||||
|
// //返回订单时间筛选项
|
||||||
|
// 'time' => [
|
||||||
|
// ['key' => 0, 'name' => 'All'],
|
||||||
|
// ['key' => 1, 'name' => 'within a month'],
|
||||||
|
// ['key' => 2, 'name' => 'within a quarter'],
|
||||||
|
// ['key' => 3, 'name' => 'Within half a year'],
|
||||||
|
// ['key' => 4, 'name' => 'Within a year'],
|
||||||
|
// ],
|
||||||
|
// //退款原因说明项
|
||||||
|
// 'refund_reason' => [
|
||||||
|
// ['key' => 1, 'name' => 'I don\'t want it anymore'],
|
||||||
|
// ['key' => 2, 'name' => 'no reason'],
|
||||||
|
// ['key' => 3, 'name' => 'other'],
|
||||||
|
// ],
|
||||||
|
// //物流状态筛选项
|
||||||
|
// 'logistics_status' => [
|
||||||
|
// ['key' => -1, "name" => 'All'],
|
||||||
|
// ['key' => 1, "name" => 'Draw', 'button' => []],
|
||||||
|
// ['key' => 2, "name" => 'Shipping', 'button' => []],
|
||||||
|
// // ['key' => Deliver::STATUS_PORT, "name" => 'To the port', 'button' => []],
|
||||||
|
// ['key' => 3, "name" => 'UPS pick up', 'button' => ['check_detail']],
|
||||||
|
// ['key' => 4, "name" => 'Arrival', 'button' => []],
|
||||||
|
// ]
|
||||||
|
// ];
|
|
@ -1,7 +1,8 @@
|
||||||
package svc
|
package svc
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fusenapi/home-user-auth/internal/config"
|
"fusenapi/server/home-user-auth/internal/config"
|
||||||
|
|
||||||
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
"github.com/zeromicro/go-zero/core/stores/sqlx"
|
||||||
)
|
)
|
||||||
|
|
|
@ -69,6 +69,28 @@ type DataGetType struct {
|
||||||
Name string `db:"name" json:"name"` // 餐厅名字
|
Name string `db:"name" json:"name"` // 餐厅名字
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type KeyName struct {
|
||||||
|
Key string `json:"key"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type KeyNameButton struct {
|
||||||
|
Key string `json:"key"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Button []string `json:"button"`
|
||||||
|
}
|
||||||
|
|
||||||
|
type DataStatusConfig struct {
|
||||||
|
SearchList []KeyName `json:"search_list"` //搜索下拉列表
|
||||||
|
OrderStatus []KeyNameButton `json:"order_status"` //直邮单状态
|
||||||
|
InventoryStatus []KeyNameButton `json:"Inventory_status"` //云仓单状态
|
||||||
|
OrderLogisticsStatus []KeyName `json:"order_logistics_status"` //订单物流状态
|
||||||
|
InventoryLogisticsStatus []KeyName `json:"Inventory_logistics_status"` //订单物流状态
|
||||||
|
Time []KeyName `json:"time"` //返回订单时间筛选项
|
||||||
|
RefundReason []KeyName `json:"refund_reason"` //退款原因说明项
|
||||||
|
LogisticsStatus []KeyName `json:"logistics_status"` //物流状态筛选项
|
||||||
|
}
|
||||||
|
|
||||||
type Response struct {
|
type Response struct {
|
||||||
Code int `json:"code"`
|
Code int `json:"code"`
|
||||||
Message string `json:"msg"`
|
Message string `json:"msg"`
|
|
@ -30,4 +30,5 @@ type Auth {
|
||||||
AccessSecret string `json:"accessSecret"`
|
AccessSecret string `json:"accessSecret"`
|
||||||
AccessExpire int64 `json:"accessExpire"`
|
AccessExpire int64 `json:"accessExpire"`
|
||||||
RefreshAfter int64 `json:"refreshAfter"`
|
RefreshAfter int64 `json:"refreshAfter"`
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,4 +103,29 @@ type DataUserBasicInfo {
|
||||||
type DataGetType {
|
type DataGetType {
|
||||||
Id int64 `db:"id" json:"key"` // ID
|
Id int64 `db:"id" json:"key"` // ID
|
||||||
Name string `db:"name" json:"name"` // 餐厅名字
|
Name string `db:"name" json:"name"` // 餐厅名字
|
||||||
|
}
|
||||||
|
|
||||||
|
// KeyName 普通的key name 对象结构. eg: /user/status-config 用在返回值
|
||||||
|
type KeyName {
|
||||||
|
Key string `json:"key"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// KeyNameButton 普通的key name button 对象结构 eg: /user/status-config 用在返回值
|
||||||
|
type KeyNameButton {
|
||||||
|
Key string `json:"key"`
|
||||||
|
Name string `json:"name"`
|
||||||
|
Button []string `json:"button"`
|
||||||
|
}
|
||||||
|
|
||||||
|
// DataStatusConfig /user/status-config 返回值data结构
|
||||||
|
type DataStatusConfig {
|
||||||
|
SearchList []KeyName `json:"search_list"` //搜索下拉列表
|
||||||
|
OrderStatus []KeyNameButton `json:"order_status"` //直邮单状态
|
||||||
|
InventoryStatus []KeyNameButton `json:"Inventory_status"` //云仓单状态
|
||||||
|
OrderLogisticsStatus []KeyName `json:"order_logistics_status"` //订单物流状态
|
||||||
|
InventoryLogisticsStatus []KeyName `json:"Inventory_logistics_status"` //订单物流状态
|
||||||
|
Time []KeyName `json:"time"` //返回订单时间筛选项
|
||||||
|
RefundReason []KeyName `json:"refund_reason"` //退款原因说明项
|
||||||
|
LogisticsStatus []KeyName `json:"logistics_status"` //物流状态筛选项
|
||||||
}
|
}
|
Loading…
Reference in New Issue
Block a user