first commit

This commit is contained in:
2024-10-02 00:57:17 +08:00
commit 6773f86bc5
312 changed files with 19169 additions and 0 deletions

31
apps/admin/Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
FROM golang:alpine AS builder
LABEL stage=gobuilder
ENV CGO_ENABLED 0
ENV GOPROXY https://goproxy.cn,direct
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update --no-cache && apk add --no-cache tzdata
WORKDIR /build
ADD go.mod .
ADD go.sum .
RUN go mod download
COPY . .
COPY apps/admin/etc /app/etc
RUN go build -ldflags="-s -w" -o /app/admin apps/admin/.\admin.go
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai
ENV TZ Asia/Shanghai
WORKDIR /app
COPY --from=builder /app/admin /app/admin
COPY --from=builder /app/etc /app/etc
CMD ["./admin", "-f", "etc/admin-api.yaml"]

154
apps/admin/admin.api Normal file
View File

@@ -0,0 +1,154 @@
syntax = "v1"
info (
title: "Enterprise API"
desc: "API for managing enterprise reviews and authentication"
author: "Your Name"
date: "2024-09-25"
)
type (
LoginReq {
Username string `json:"username"`
Password string `json:"password"`
}
LoginResp {}
)
type (
GetPendingEnterpriseReq {
Page int64 `form:"page"`
PageSize int64 `form:"pageSize"`
}
GetPendingEnterpriseResp {
Total int64 `json:"total"`
List []EnterpriseItem `json:"list"`
}
ReviewEnterpriseReq {
EnterpriseID int64 `json:"enterpriseId"`
Status string `json:"status"`
Remarks string `json:"remarks"`
}
ReviewEnterpriseResp {}
)
type EnterpriseItem {
Id int64 `json:"id"` // 企业ID
EnterpriseName string `json:"enterpriseName"` // 企业名称
CreditCode string `json:"creditCode"` // 企业信用代码
LegalPerson string `json:"legalPerson"` // 法人
EnterpriseContact string `json:"enterpriseContact"` // 企业联系方式
AuthStatus string `json:"authStatus"` // 认证状态
BusinessLicense string `json:"businessLicense"`
CreatedAt string `json:"createdAt"` // 创建时间
UpdatedAt string `json:"updatedAt"` // 更新时间
}
type (
UserInfoResp {
username string `json:"username"`
}
)
@server (
group: auth
prefix: /api/admin/auth
)
service admin-api {
@handler login
post /login (LoginReq) returns (LoginResp)
}
@server (
group: user
prefix: /api/admin/user
middleware: AuthInterceptor
)
service admin-api {
@handler getUserInfo
get /info returns (UserInfoResp)
}
@server (
group: review
prefix: /api/admin/enterprise
middleware: AuthInterceptor
)
service admin-api {
@handler reviewEnterprise
post /review (ReviewEnterpriseReq) returns (ReviewEnterpriseResp)
@handler getPendingEnterprise
get /pending (GetPendingEnterpriseReq) returns (GetPendingEnterpriseResp)
}
type (
CreateProductReq {
ProductName string `json:"productName"`
ProductCode string `json:"productCode"`
ProductDescription string `json:"productDescription"`
ProductContent string `json:"productContent"`
ProductGroup string `json:"productGroup"`
ProductPrice float64 `json:"productPrice"`
}
UpdateProductReq {
ProductId int64 `json:"productId"`
ProductName string `json:"productName"`
ProductCode string `json:"productCode"`
ProductDescription string `json:"productDescription"`
ProductContent string `json:"productContent"`
ProductGroup string `json:"productGroup"`
ProductPrice float64 `json:"productPrice"`
}
DeleteProductReq {
ProductId int64 `json:"productId"`
}
GetProductByIdReq {
ProductId int64 `path:"productId"`
}
GetProductByIdResp {
ProductItem
}
GetProductListReq {
Page int64 `form:"page"`
PageSize int64 `form:"pageSize"`
}
GetProductListResp {
Total int64 `json:"total"`
List []ProductItem `json:"list"`
}
ProductItem {
ProductId int64 `json:"productId"`
ProductName string `json:"productName"`
ProductCode string `json:"productCode"`
ProductDescription string `json:"productDescription"`
ProductContent string `json:"productContent"`
ProductGroup string `json:"productGroup"`
ProductPrice float64 `json:"productPrice"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
)
@server (
group: product
prefix: /api/admin/product
middleware: AuthInterceptor
)
service admin-api {
@handler createProduct
post /create (CreateProductReq)
@handler updateProduct
post /update (UpdateProductReq)
@handler deleteProduct
post /delete (DeleteProductReq)
@handler getProductById
get /:productId (GetProductByIdReq) returns (GetProductByIdResp)
@handler getProductList
get /list (GetProductListReq) returns (GetProductListResp)
}

31
apps/admin/admin.go Normal file
View File

@@ -0,0 +1,31 @@
package main
import (
"flag"
"fmt"
"tianyuan-api/apps/admin/internal/config"
"tianyuan-api/apps/admin/internal/handler"
"tianyuan-api/apps/admin/internal/svc"
"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/rest"
)
var configFile = flag.String("f", "etc/admin-api.yaml", "the config file")
func main() {
flag.Parse()
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
defer server.Stop()
ctx := svc.NewServiceContext(c)
handler.RegisterHandlers(server, ctx)
fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port)
server.Start()
}

View File

@@ -0,0 +1,22 @@
Name: admin-api
Host: 0.0.0.0
Port: 10002
DataSource: "tianyuanapi:g3h98u0291j@tcp(127.0.0.1:3307)/tianyuanapi?charset=utf8mb4&parseTime=True&loc=Local"
AuthJWT:
AccessSecret: "Mf5Xph3PoyKzVpRw0Zy1+X4uR/tM7JvGMEV/5p2M/tU="
AccessExpire: 86400 # JWT过期时间
CacheRedis:
- Host: "127.0.0.1:6379"
Pass: "" # Redis 密码,如果未设置则留空
Type: "node" # 单节点模式
UserRpc:
Etcd:
Hosts:
- 127.0.0.1:2379
Key: user.rpc
SentinelRpc:
Etcd:
Hosts:
- 127.0.0.1:2379
Key: sentinel.rpc

View File

@@ -0,0 +1,22 @@
package config
import (
"github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/rest"
"github.com/zeromicro/go-zero/zrpc"
)
type Config struct {
rest.RestConf
DataSource string // 数据库连接的 DSN 字符串
AuthJWT AuthConfig // JWT 鉴权相关配置
CacheRedis cache.CacheConf // 缓存配置,使用 go-zero 自带的缓存配置结构体
UserRpc zrpc.RpcClientConf
SentinelRpc zrpc.RpcClientConf
}
// AuthConfig 用于 JWT 鉴权配置
type AuthConfig struct {
AccessSecret string // JWT 密钥,用于签发 Token
AccessExpire int64 // Token 过期时间,单位为秒
}

View File

@@ -0,0 +1,40 @@
package auth
import (
"net/http"
"time"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/admin/internal/logic/auth"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func LoginHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.LoginReq
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := auth.NewLoginLogic(r.Context(), svcCtx)
token, err := l.Login(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
http.SetCookie(w, &http.Cookie{
Name: "Authorization",
Value: token, // JWT 令牌
HttpOnly: true, // 防止 JavaScript 访问
Secure: false, // HTTPS 使用
SameSite: http.SameSiteLaxMode, // 防止 CSRF 攻击
Path: "/",
Expires: time.Now().Add(time.Duration(svcCtx.Config.AuthJWT.AccessExpire) * time.Second), // 过期时间
})
xhttp.JsonBaseResponseCtx(r.Context(), w, nil)
}
}
}

View File

@@ -0,0 +1,30 @@
package product
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/admin/internal/logic/product"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func CreateProductHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.CreateProductReq
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := product.NewCreateProductLogic(r.Context(), svcCtx)
err := l.CreateProduct(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, nil)
}
}
}

View File

@@ -0,0 +1,30 @@
package product
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/admin/internal/logic/product"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func DeleteProductHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.DeleteProductReq
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := product.NewDeleteProductLogic(r.Context(), svcCtx)
err := l.DeleteProduct(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, nil)
}
}
}

View File

@@ -0,0 +1,30 @@
package product
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/admin/internal/logic/product"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func GetProductByIdHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.GetProductByIdReq
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := product.NewGetProductByIdLogic(r.Context(), svcCtx)
resp, err := l.GetProductById(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package product
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/admin/internal/logic/product"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func GetProductListHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.GetProductListReq
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := product.NewGetProductListLogic(r.Context(), svcCtx)
resp, err := l.GetProductList(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package product
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/admin/internal/logic/product"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func UpdateProductHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.UpdateProductReq
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := product.NewUpdateProductLogic(r.Context(), svcCtx)
err := l.UpdateProduct(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, nil)
}
}
}

View File

@@ -0,0 +1,30 @@
package review
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/admin/internal/logic/review"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func GetPendingEnterpriseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.GetPendingEnterpriseReq
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := review.NewGetPendingEnterpriseLogic(r.Context(), svcCtx)
resp, err := l.GetPendingEnterprise(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package review
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/admin/internal/logic/review"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func ReviewEnterpriseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.ReviewEnterpriseReq
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := review.NewReviewEnterpriseLogic(r.Context(), svcCtx)
resp, err := l.ReviewEnterprise(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,96 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.7.2
package handler
import (
"net/http"
auth "tianyuan-api/apps/admin/internal/handler/auth"
product "tianyuan-api/apps/admin/internal/handler/product"
review "tianyuan-api/apps/admin/internal/handler/review"
user "tianyuan-api/apps/admin/internal/handler/user"
"tianyuan-api/apps/admin/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
[]rest.Route{
{
Method: http.MethodPost,
Path: "/login",
Handler: auth.LoginHandler(serverCtx),
},
},
rest.WithPrefix("/api/admin/auth"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.AuthInterceptor},
[]rest.Route{
{
Method: http.MethodGet,
Path: "/:productId",
Handler: product.GetProductByIdHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/create",
Handler: product.CreateProductHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/delete",
Handler: product.DeleteProductHandler(serverCtx),
},
{
Method: http.MethodGet,
Path: "/list",
Handler: product.GetProductListHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/update",
Handler: product.UpdateProductHandler(serverCtx),
},
}...,
),
rest.WithPrefix("/api/admin/product"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.AuthInterceptor},
[]rest.Route{
{
Method: http.MethodGet,
Path: "/pending",
Handler: review.GetPendingEnterpriseHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/review",
Handler: review.ReviewEnterpriseHandler(serverCtx),
},
}...,
),
rest.WithPrefix("/api/admin/enterprise"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.AuthInterceptor},
[]rest.Route{
{
Method: http.MethodGet,
Path: "/info",
Handler: user.GetUserInfoHandler(serverCtx),
},
}...,
),
rest.WithPrefix("/api/admin/user"),
)
}

View File

@@ -0,0 +1,21 @@
package user
import (
"net/http"
xhttp "github.com/zeromicro/x/http"
"tianyuan-api/apps/admin/internal/logic/user"
"tianyuan-api/apps/admin/internal/svc"
)
func GetUserInfoHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
l := user.NewGetUserInfoLogic(r.Context(), svcCtx)
resp, err := l.GetUserInfo()
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,45 @@
package auth
import (
"context"
"errors"
jwtx "tianyuan-api/pkg/jwt"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type LoginLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewLoginLogic(ctx context.Context, svcCtx *svc.ServiceContext) *LoginLogic {
return &LoginLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *LoginLogic) Login(req *types.LoginReq) (token string, err error) {
if req.Username == "" || req.Password == "" {
return "", errors.New("用户名或密码不能为空")
}
if req.Username != "SkyWalker_8273" && req.Password != "mD$9tPzQ&1kB2z%L" {
return "", errors.New("密码错误")
}
// 生成 JWT token调用封装好的函数
token, err = jwtx.GenerateJwtToken(1, l.svcCtx.Config.AuthJWT.AccessSecret, l.svcCtx.Config.AuthJWT.AccessExpire)
if err != nil {
return "", err
}
// 返回成功的登录响应
return token, nil
}

View File

@@ -0,0 +1,40 @@
package product
import (
"context"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
"tianyuan-api/apps/sentinel/client/product"
"github.com/zeromicro/go-zero/core/logx"
)
type CreateProductLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewCreateProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *CreateProductLogic {
return &CreateProductLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *CreateProductLogic) CreateProduct(req *types.CreateProductReq) error {
_, err := l.svcCtx.ProductRpc.CreateProduct(l.ctx, &product.CreateProductRequest{
ProductName: req.ProductName,
ProductCode: req.ProductCode,
ProductDescription: req.ProductDescription,
ProductContent: req.ProductContent,
ProductPrice: req.ProductPrice,
ProductGroup: req.ProductGroup,
})
if err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,36 @@
package product
import (
"context"
"tianyuan-api/apps/sentinel/client/product"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type DeleteProductLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewDeleteProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *DeleteProductLogic {
return &DeleteProductLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *DeleteProductLogic) DeleteProduct(req *types.DeleteProductReq) error {
_, err := l.svcCtx.ProductRpc.DeleteProduct(l.ctx, &product.DeleteProductRequest{
Id: req.ProductId,
})
if err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,46 @@
package product
import (
"context"
"tianyuan-api/apps/sentinel/client/product"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type GetProductByIdLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetProductByIdLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetProductByIdLogic {
return &GetProductByIdLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *GetProductByIdLogic) GetProductById(req *types.GetProductByIdReq) (resp *types.GetProductByIdResp, err error) {
productResp, err := l.svcCtx.ProductRpc.GetProductById(l.ctx, &product.GetRecordByIdRequest{
Id: req.ProductId,
})
if err != nil {
return nil, err
}
return &types.GetProductByIdResp{
ProductItem: types.ProductItem{
ProductId: productResp.Id,
ProductName: productResp.ProductName,
ProductCode: productResp.ProductCode,
ProductDescription: productResp.ProductDescription,
ProductContent: productResp.ProductContent,
ProductPrice: productResp.ProductPrice,
ProductGroup: productResp.ProductGroup,
},
}, nil
}

View File

@@ -0,0 +1,50 @@
package product
import (
"context"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
"tianyuan-api/apps/sentinel/client/product"
"github.com/zeromicro/go-zero/core/logx"
)
type GetProductListLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetProductListLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetProductListLogic {
return &GetProductListLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *GetProductListLogic) GetProductList(req *types.GetProductListReq) (resp *types.GetProductListResp, err error) {
productList, err := l.svcCtx.ProductRpc.GetProductPageList(l.ctx, &product.PageListRequest{Page: req.Page, PageSize: req.PageSize})
if err != nil {
return nil, err
}
var list []types.ProductItem
for _, p := range productList.Products {
list = append(list, types.ProductItem{
ProductId: p.Id,
ProductName: p.ProductName,
ProductCode: p.ProductCode,
ProductDescription: p.ProductDescription,
ProductPrice: p.ProductPrice,
ProductGroup: p.ProductGroup,
CreatedAt: p.CreatedAt,
UpdatedAt: p.UpdatedAt,
})
}
resp = &types.GetProductListResp{
Total: productList.Total,
List: list,
}
return resp, nil
}

View File

@@ -0,0 +1,42 @@
package product
import (
"context"
"tianyuan-api/apps/sentinel/client/product"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type UpdateProductLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewUpdateProductLogic(ctx context.Context, svcCtx *svc.ServiceContext) *UpdateProductLogic {
return &UpdateProductLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *UpdateProductLogic) UpdateProduct(req *types.UpdateProductReq) error {
_, err := l.svcCtx.ProductRpc.UpdateProduct(l.ctx, &product.UpdateProductRequest{
Id: req.ProductId,
ProductName: req.ProductName,
ProductCode: req.ProductCode,
ProductDescription: req.ProductDescription,
ProductContent: req.ProductContent,
ProductPrice: req.ProductPrice,
ProductGroup: req.ProductGroup,
})
if err != nil {
return err
}
return nil
}

View File

@@ -0,0 +1,52 @@
package review
import (
"context"
"tianyuan-api/apps/user/client/enterprise"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type GetPendingEnterpriseLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetPendingEnterpriseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetPendingEnterpriseLogic {
return &GetPendingEnterpriseLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *GetPendingEnterpriseLogic) GetPendingEnterprise(req *types.GetPendingEnterpriseReq) (resp *types.GetPendingEnterpriseResp, err error) {
pendingEnterpriseList, err := l.svcCtx.EntRpc.GetPendingEnterprise(l.ctx, &enterprise.GetPendingEnterpriseReq{Page: req.Page, PageSize: req.PageSize})
if err != nil {
return nil, err
}
var list []types.EnterpriseItem
for _, ent := range pendingEnterpriseList.List {
list = append(list, types.EnterpriseItem{
Id: ent.Id,
EnterpriseName: ent.EnterpriseName,
EnterpriseContact: ent.EnterpriseContact,
CreditCode: ent.CreditCode,
LegalPerson: ent.LegalPerson,
AuthStatus: ent.AuthStatus,
BusinessLicense: ent.BusinessLicense,
UpdatedAt: ent.UpdatedAt,
CreatedAt: ent.CreatedAt,
})
}
resp = &types.GetPendingEnterpriseResp{
Total: pendingEnterpriseList.Total,
List: list,
}
return resp, nil
}

View File

@@ -0,0 +1,37 @@
package review
import (
"context"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
"tianyuan-api/apps/user/client/enterprise"
"github.com/zeromicro/go-zero/core/logx"
)
type ReviewEnterpriseLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewReviewEnterpriseLogic(ctx context.Context, svcCtx *svc.ServiceContext) *ReviewEnterpriseLogic {
return &ReviewEnterpriseLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *ReviewEnterpriseLogic) ReviewEnterprise(req *types.ReviewEnterpriseReq) (resp *types.ReviewEnterpriseResp, err error) {
_, err = l.svcCtx.EntRpc.ReviewEnterprise(l.ctx, &enterprise.ReviewEnterpriseReq{
EnterpriseId: req.EnterpriseID,
Status: req.Status,
Remarks: req.Remarks,
})
if err != nil {
return nil, err
}
return &types.ReviewEnterpriseResp{}, nil
}

View File

@@ -0,0 +1,30 @@
package user
import (
"context"
"tianyuan-api/apps/admin/internal/svc"
"tianyuan-api/apps/admin/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type GetUserInfoLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewGetUserInfoLogic(ctx context.Context, svcCtx *svc.ServiceContext) *GetUserInfoLogic {
return &GetUserInfoLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *GetUserInfoLogic) GetUserInfo() (resp *types.UserInfoResp, err error) {
return &types.UserInfoResp{
Username: "admin",
}, nil
}

View File

@@ -0,0 +1,54 @@
package middleware
import (
"context"
"errors"
"github.com/zeromicro/go-zero/core/logx"
xhttp "github.com/zeromicro/x/http"
"tianyuan-api/apps/admin/internal/config"
jwtx "tianyuan-api/pkg/jwt"
"net/http"
"time"
)
type AuthInterceptorMiddleware struct {
Config config.Config
}
func NewAuthInterceptorMiddleware(c config.Config) *AuthInterceptorMiddleware {
return &AuthInterceptorMiddleware{
Config: c,
}
}
func (m *AuthInterceptorMiddleware) Handle(next http.HandlerFunc) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
// 从 Cookie 中获取 JWT
cookie, err := r.Cookie("Authorization")
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, errors.New("用户未登录"))
return
}
tokenStr := cookie.Value
// 验证并解析 JWT
userId, err := jwtx.ParseJwtToken(tokenStr, m.Config.AuthJWT.AccessSecret)
if err != nil {
// 设置过期的 Cookie 来删除无效的 Token
http.SetCookie(w, &http.Cookie{
Name: "Authorization",
Value: "",
Path: "/",
HttpOnly: true,
Expires: time.Unix(0, 0), // 过期时间设置为过去
})
logx.Error("Invalid JWT: ", err)
xhttp.JsonBaseResponseCtx(r.Context(), w, errors.New("未经授权的访问"))
return
}
// 将 userId 存入 context供后续逻辑使用
ctx := context.WithValue(r.Context(), "userId", userId)
next(w, r.WithContext(ctx))
}
}

View File

@@ -0,0 +1,28 @@
package svc
import (
"github.com/zeromicro/go-zero/rest"
"github.com/zeromicro/go-zero/zrpc"
"tianyuan-api/apps/admin/internal/config"
"tianyuan-api/apps/admin/internal/middleware"
"tianyuan-api/apps/sentinel/sentinel"
"tianyuan-api/apps/user/user"
)
type ServiceContext struct {
Config config.Config
AuthInterceptor rest.Middleware
EntRpc user.EnterpriseClient
UserRpc user.UserClient
ProductRpc sentinel.ProductClient
}
func NewServiceContext(c config.Config) *ServiceContext {
return &ServiceContext{
Config: c,
AuthInterceptor: middleware.NewAuthInterceptorMiddleware(c).Handle,
EntRpc: user.NewEnterpriseClient(zrpc.MustNewClient(c.UserRpc).Conn()),
UserRpc: user.NewUserClient(zrpc.MustNewClient(c.UserRpc).Conn()),
ProductRpc: sentinel.NewProductClient(zrpc.MustNewClient(c.SentinelRpc).Conn()),
}
}

View File

@@ -0,0 +1,100 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.7.2
package types
type CreateProductReq struct {
ProductName string `json:"productName"`
ProductCode string `json:"productCode"`
ProductDescription string `json:"productDescription"`
ProductContent string `json:"productContent"`
ProductGroup string `json:"productGroup"`
ProductPrice float64 `json:"productPrice"`
}
type DeleteProductReq struct {
ProductId int64 `json:"productId"`
}
type EnterpriseItem struct {
Id int64 `json:"id"` // 企业ID
EnterpriseName string `json:"enterpriseName"` // 企业名称
CreditCode string `json:"creditCode"` // 企业信用代码
LegalPerson string `json:"legalPerson"` // 法人
EnterpriseContact string `json:"enterpriseContact"` // 企业联系方式
AuthStatus string `json:"authStatus"` // 认证状态
BusinessLicense string `json:"businessLicense"`
CreatedAt string `json:"createdAt"` // 创建时间
UpdatedAt string `json:"updatedAt"` // 更新时间
}
type GetPendingEnterpriseReq struct {
Page int64 `form:"page"`
PageSize int64 `form:"pageSize"`
}
type GetPendingEnterpriseResp struct {
Total int64 `json:"total"`
List []EnterpriseItem `json:"list"`
}
type GetProductByIdReq struct {
ProductId int64 `path:"productId"`
}
type GetProductByIdResp struct {
ProductItem
}
type GetProductListReq struct {
Page int64 `form:"page"`
PageSize int64 `form:"pageSize"`
}
type GetProductListResp struct {
Total int64 `json:"total"`
List []ProductItem `json:"list"`
}
type LoginReq struct {
Username string `json:"username"`
Password string `json:"password"`
}
type LoginResp struct {
}
type ProductItem struct {
ProductId int64 `json:"productId"`
ProductName string `json:"productName"`
ProductCode string `json:"productCode"`
ProductDescription string `json:"productDescription"`
ProductContent string `json:"productContent"`
ProductGroup string `json:"productGroup"`
ProductPrice float64 `json:"productPrice"`
CreatedAt string `json:"createdAt"`
UpdatedAt string `json:"updatedAt"`
}
type ReviewEnterpriseReq struct {
EnterpriseID int64 `json:"enterpriseId"`
Status string `json:"status"`
Remarks string `json:"remarks"`
}
type ReviewEnterpriseResp struct {
}
type UpdateProductReq struct {
ProductId int64 `json:"productId"`
ProductName string `json:"productName"`
ProductCode string `json:"productCode"`
ProductDescription string `json:"productDescription"`
ProductContent string `json:"productContent"`
ProductGroup string `json:"productGroup"`
ProductPrice float64 `json:"productPrice"`
}
type UserInfoResp struct {
Username string `json:"username"`
}

31
apps/api/Dockerfile Normal file
View File

@@ -0,0 +1,31 @@
FROM golang:alpine AS builder
LABEL stage=gobuilder
ENV CGO_ENABLED 0
ENV GOPROXY https://goproxy.cn,direct
RUN sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories
RUN apk update --no-cache && apk add --no-cache tzdata
WORKDIR /build
ADD go.mod .
ADD go.sum .
RUN go mod download
COPY . .
COPY apps/api/etc /app/etc
RUN go build -ldflags="-s -w" -o /app/api apps/api/api.go
FROM scratch
COPY --from=builder /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY --from=builder /usr/share/zoneinfo/Asia/Shanghai /usr/share/zoneinfo/Asia/Shanghai
ENV TZ Asia/Shanghai
WORKDIR /app
COPY --from=builder /app/api /app/api
COPY --from=builder /app/etc /app/etc
CMD ["./api", "-f", "etc/api-api.yaml"]

154
apps/api/api.api Normal file
View File

@@ -0,0 +1,154 @@
syntax = "v1"
info (
title: "User Management API"
desc: "This API is designed for managing user information and authentication."
author: "Liang Zai"
version: "v1.0.0"
)
type request {
data string `json:"data"`
}
type response {
data string `json:"data"`
}
@server (
group: IVYZ
prefix: /api/v1
middleware: ApiAuthInterceptor
)
service api-api {
@handler IVYZ0B03
post /IVYZ0B03 (request) returns (response)
@handler IVYZ5733
post /IVYZ5733 (request) returns (response)
@handler IVYZ9363
post /IVYZ9363 (request) returns (response)
@handler IVYZ385E
post /IVYZ385E (request) returns (response)
@handler IVYZ2125
post /IVYZ2125 (request) returns (response)
@handler IVYZADEE
post /IVYZADEE (request) returns (response)
}
@server (
group: FLXG
prefix: /api/v1
middleware: ApiAuthInterceptor
)
service api-api {
@handler FLXGCA3D
post /FLXGCA3D (request) returns (response)
@handler FLXG970F
post /FLXG970F (request) returns (response)
@handler FLXG75FE
post /FLXG75FE (request) returns (response)
@handler FLXGDEC7
post /FLXGDEC7 (request) returns (response)
@handler FLXG5876
post /FLXG5876 (request) returns (response)
@handler FLXG54F5
post /FLXG54F5 (request) returns (response)
@handler FLXGC9D1
post /FLXGC9D1 (request) returns (response)
@handler FLXG9687
post /FLXG9687 (request) returns (response)
@handler FLXG162A
post /FLXG162A (request) returns (response)
@handler FLXG3D56
post /FLXG3D56 (request) returns (response)
}
@server (
group: QYGL
prefix: /api/v1
middleware: ApiAuthInterceptor
)
service api-api {
@handler QYGLB4C0
post /QYGLB4C0 (request) returns (response)
@handler QYGL8261
post /QYGL8261 (request) returns (response)
@handler QYGL45BD
post /QYGL45BD (request) returns (response)
@handler QYGL2ACD
post /QYGL2ACD (request) returns (response)
@handler QYGL6F2D
post /QYGL6F2D (request) returns (response)
@handler QYGL51BC
post /QYGL51BC (request) returns (response)
}
@server (
group: YYSY
prefix: /api/v1
middleware: ApiAuthInterceptor
)
service api-api {
@handler YYSY6F2E
post /YYSY6F2E (request) returns (response)
@handler YYSY09CD
post /YYSY09CD (request) returns (response)
@handler YYSYBE08
post /YYSYBE08 (request) returns (response)
@handler YYSYD50F
post /YYSYD50F (request) returns (response)
@handler YYSYF7DB
post /YYSYF7DB (request) returns (response)
@handler YYSY4B37
post /YYSY4B37 (request) returns (response)
}
@server (
group: JRZQ
prefix: /api/v1
middleware: ApiAuthInterceptor
)
service api-api {
@handler JRZQDCBE
post /JRZQDCBE (request) returns (response)
@handler JRZQ0A03
post /JRZQ0A03 (request) returns (response)
@handler JRZQ8203
post /JRZQ8203 (request) returns (response)
@handler JRZQ4AA8
post /JRZQ4AA8 (request) returns (response)
@handler JRZQCEE8
post /JRZQCEE8 (request) returns (response)
@handler JRZQFEF8
post /JRZQFEF8 (request) returns (response)
}

31
apps/api/api.go Normal file
View File

@@ -0,0 +1,31 @@
package main
import (
"flag"
"fmt"
"tianyuan-api/apps/api/internal/config"
"tianyuan-api/apps/api/internal/handler"
"tianyuan-api/apps/api/internal/svc"
"github.com/zeromicro/go-zero/core/conf"
"github.com/zeromicro/go-zero/rest"
)
var configFile = flag.String("f", "etc/api-api.yaml", "the config file")
func main() {
flag.Parse()
var c config.Config
conf.MustLoad(*configFile, &c)
server := rest.MustNewServer(c.RestConf)
defer server.Stop()
ctx := svc.NewServiceContext(c)
handler.RegisterHandlers(server, ctx)
fmt.Printf("Starting server at %s:%d...\n", c.Host, c.Port)
server.Start()
}

51
apps/api/api.proto Normal file
View File

@@ -0,0 +1,51 @@
syntax = "proto3";
package product;
option go_package = "./api";
service ProductService {
// 获取产品列表
rpc GetProducts(ProductListReq) returns (ProductListResp);
// 获取用户开通的产品列表
rpc GetUserProducts(UserProductListReq) returns (UserProductListResp);
}
// 获取产品列表的请求
message ProductListReq {}
// 获取产品列表的响应
message ProductListResp {
repeated ProductItem products = 1;
}
// 产品信息
message ProductItem {
int64 id = 1; // 产品ID
string product_name = 2; // 产品名称
string product_code = 3; // 产品编号
string product_description = 4; // 产品简介
string product_content = 5; // 产品内容
float product_price = 6; // 产品价格
string created_at = 7; // 产品创建时间
}
// 获取用户开通的产品列表的请求
message UserProductListReq {
int64 user_id = 1; // 用户ID
}
// 获取用户开通的产品列表的响应
message UserProductListResp {
repeated UserProductItem user_products = 1;
}
// 用户产品信息
message UserProductItem {
int64 id = 1; // 用户产品ID
int64 user_id = 2; // 用户ID
int64 product_id = 3; // 产品ID
string activation_date = 4; // 激活时间
string expiration_date = 5; // 到期时间
}

20
apps/api/etc/api-api.yaml Normal file
View File

@@ -0,0 +1,20 @@
Name: api-api
Host: 0.0.0.0
Port: 10003
DataSource: "tianyuanapi:g3h98u0291j@tcp(127.0.0.1:3307)/tianyuanapi?charset=utf8mb4&parseTime=True&loc=Local"
CacheRedis:
- Host: "127.0.0.1:6379"
Pass: "" # Redis 密码,如果未设置则留空
Type: "node" # 单节点模式
SentinelRpc:
Etcd:
Hosts:
- 127.0.0.1:2379
Key: sentinel.rpc
KqPusherConf:
Brokers:
- 127.0.0.1:9092
Topic: apirequest
WestConfig:
key: "121a1e41fc1690dd6b90afbcacd80cf4"
secretId: "449159"

View File

@@ -0,0 +1,24 @@
package config
import (
"github.com/zeromicro/go-zero/core/stores/cache"
"github.com/zeromicro/go-zero/rest"
"github.com/zeromicro/go-zero/zrpc"
)
type Config struct {
rest.RestConf
DataSource string // 数据库连接的 DSN 字符串
CacheRedis cache.CacheConf // 缓存配置,使用 go-zero 自带的缓存配置结构体
SentinelRpc zrpc.RpcClientConf
KqPusherConf KqPusherConf
WestConfig WestConfig
}
type KqPusherConf struct {
Brokers []string
Topic string
}
type WestConfig struct {
Key string
SecretId string
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/FLXG"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func FLXG162AHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := FLXG.NewFLXG162ALogic(r.Context(), svcCtx)
resp, err := l.FLXG162A(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/FLXG"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func FLXG3D56Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := FLXG.NewFLXG3D56Logic(r.Context(), svcCtx)
resp, err := l.FLXG3D56(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/FLXG"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func FLXG54F5Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := FLXG.NewFLXG54F5Logic(r.Context(), svcCtx)
resp, err := l.FLXG54F5(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/FLXG"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func FLXG5876Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := FLXG.NewFLXG5876Logic(r.Context(), svcCtx)
resp, err := l.FLXG5876(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/FLXG"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func FLXG75FEHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := FLXG.NewFLXG75FELogic(r.Context(), svcCtx)
resp, err := l.FLXG75FE(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/FLXG"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func FLXG9687Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := FLXG.NewFLXG9687Logic(r.Context(), svcCtx)
resp, err := l.FLXG9687(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/FLXG"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func FLXG970FHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := FLXG.NewFLXG970FLogic(r.Context(), svcCtx)
resp, err := l.FLXG970F(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/FLXG"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func FLXGC9D1Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := FLXG.NewFLXGC9D1Logic(r.Context(), svcCtx)
resp, err := l.FLXGC9D1(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/FLXG"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func FLXGCA3DHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := FLXG.NewFLXGCA3DLogic(r.Context(), svcCtx)
resp, err := l.FLXGCA3D(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/FLXG"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func FLXGDEC7Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := FLXG.NewFLXGDEC7Logic(r.Context(), svcCtx)
resp, err := l.FLXGDEC7(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/IVYZ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func IVYZ0B03Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := IVYZ.NewIVYZ0B03Logic(r.Context(), svcCtx)
resp, err := l.IVYZ0B03(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/IVYZ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func IVYZ2125Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := IVYZ.NewIVYZ2125Logic(r.Context(), svcCtx)
resp, err := l.IVYZ2125(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/IVYZ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func IVYZ385EHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := IVYZ.NewIVYZ385ELogic(r.Context(), svcCtx)
resp, err := l.IVYZ385E(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/IVYZ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func IVYZ5733Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := IVYZ.NewIVYZ5733Logic(r.Context(), svcCtx)
resp, err := l.IVYZ5733(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/IVYZ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func IVYZ9363Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := IVYZ.NewIVYZ9363Logic(r.Context(), svcCtx)
resp, err := l.IVYZ9363(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/IVYZ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func IVYZADEEHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := IVYZ.NewIVYZADEELogic(r.Context(), svcCtx)
resp, err := l.IVYZADEE(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/JRZQ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func JRZQ0A03Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := JRZQ.NewJRZQ0A03Logic(r.Context(), svcCtx)
resp, err := l.JRZQ0A03(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/JRZQ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func JRZQ4AA8Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := JRZQ.NewJRZQ4AA8Logic(r.Context(), svcCtx)
resp, err := l.JRZQ4AA8(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/JRZQ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func JRZQ8203Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := JRZQ.NewJRZQ8203Logic(r.Context(), svcCtx)
resp, err := l.JRZQ8203(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/JRZQ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func JRZQCEE8Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := JRZQ.NewJRZQCEE8Logic(r.Context(), svcCtx)
resp, err := l.JRZQCEE8(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/JRZQ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func JRZQDCBEHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := JRZQ.NewJRZQDCBELogic(r.Context(), svcCtx)
resp, err := l.JRZQDCBE(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/JRZQ"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func JRZQFEF8Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := JRZQ.NewJRZQFEF8Logic(r.Context(), svcCtx)
resp, err := l.JRZQFEF8(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package QYGL
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/QYGL"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func QYGL2ACDHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := QYGL.NewQYGL2ACDLogic(r.Context(), svcCtx)
resp, err := l.QYGL2ACD(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package QYGL
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/QYGL"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func QYGL45BDHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := QYGL.NewQYGL45BDLogic(r.Context(), svcCtx)
resp, err := l.QYGL45BD(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package QYGL
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/QYGL"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func QYGL51BCHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := QYGL.NewQYGL51BCLogic(r.Context(), svcCtx)
resp, err := l.QYGL51BC(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package QYGL
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/QYGL"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func QYGL6F2DHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := QYGL.NewQYGL6F2DLogic(r.Context(), svcCtx)
resp, err := l.QYGL6F2D(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package QYGL
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/QYGL"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func QYGL8261Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := QYGL.NewQYGL8261Logic(r.Context(), svcCtx)
resp, err := l.QYGL8261(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package QYGL
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/QYGL"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func QYGLB4C0Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := QYGL.NewQYGLB4C0Logic(r.Context(), svcCtx)
resp, err := l.QYGLB4C0(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package YYSY
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSY09CDHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := YYSY.NewYYSY09CDLogic(r.Context(), svcCtx)
resp, err := l.YYSY09CD(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package YYSY
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSY4B37Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := YYSY.NewYYSY4B37Logic(r.Context(), svcCtx)
resp, err := l.YYSY4B37(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package YYSY
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSY6F2EHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := YYSY.NewYYSY6F2ELogic(r.Context(), svcCtx)
resp, err := l.YYSY6F2E(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package YYSY
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSYBE08Handler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := YYSY.NewYYSYBE08Logic(r.Context(), svcCtx)
resp, err := l.YYSYBE08(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package YYSY
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSYD50FHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := YYSY.NewYYSYD50FLogic(r.Context(), svcCtx)
resp, err := l.YYSYD50F(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,30 @@
package YYSY
import (
"net/http"
"github.com/zeromicro/go-zero/rest/httpx"
"tianyuan-api/apps/api/internal/logic/YYSY"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
xhttp "github.com/zeromicro/x/http"
)
func YYSYF7DBHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
return func(w http.ResponseWriter, r *http.Request) {
var req types.Request
if err := httpx.Parse(r, &req); err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
return
}
l := YYSY.NewYYSYF7DBLogic(r.Context(), svcCtx)
resp, err := l.YYSYF7DB(&req)
if err != nil {
xhttp.JsonBaseResponseCtx(r.Context(), w, err)
} else {
xhttp.JsonBaseResponseCtx(r.Context(), w, resp)
}
}
}

View File

@@ -0,0 +1,234 @@
// Code generated by goctl. DO NOT EDIT.
// goctl 1.7.2
package handler
import (
"net/http"
FLXG "tianyuan-api/apps/api/internal/handler/FLXG"
IVYZ "tianyuan-api/apps/api/internal/handler/IVYZ"
JRZQ "tianyuan-api/apps/api/internal/handler/JRZQ"
QYGL "tianyuan-api/apps/api/internal/handler/QYGL"
YYSY "tianyuan-api/apps/api/internal/handler/YYSY"
"tianyuan-api/apps/api/internal/svc"
"github.com/zeromicro/go-zero/rest"
)
func RegisterHandlers(server *rest.Server, serverCtx *svc.ServiceContext) {
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
Path: "/FLXG162A",
Handler: FLXG.FLXG162AHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/FLXG3D56",
Handler: FLXG.FLXG3D56Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/FLXG54F5",
Handler: FLXG.FLXG54F5Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/FLXG5876",
Handler: FLXG.FLXG5876Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/FLXG75FE",
Handler: FLXG.FLXG75FEHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/FLXG9687",
Handler: FLXG.FLXG9687Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/FLXG970F",
Handler: FLXG.FLXG970FHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/FLXGC9D1",
Handler: FLXG.FLXGC9D1Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/FLXGCA3D",
Handler: FLXG.FLXGCA3DHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/FLXGDEC7",
Handler: FLXG.FLXGDEC7Handler(serverCtx),
},
}...,
),
rest.WithPrefix("/api/v1"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
Path: "/IVYZ0B03",
Handler: IVYZ.IVYZ0B03Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/IVYZ2125",
Handler: IVYZ.IVYZ2125Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/IVYZ385E",
Handler: IVYZ.IVYZ385EHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/IVYZ5733",
Handler: IVYZ.IVYZ5733Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/IVYZ9363",
Handler: IVYZ.IVYZ9363Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/IVYZADEE",
Handler: IVYZ.IVYZADEEHandler(serverCtx),
},
}...,
),
rest.WithPrefix("/api/v1"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
Path: "/JRZQ0A03",
Handler: JRZQ.JRZQ0A03Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/JRZQ4AA8",
Handler: JRZQ.JRZQ4AA8Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/JRZQ8203",
Handler: JRZQ.JRZQ8203Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/JRZQCEE8",
Handler: JRZQ.JRZQCEE8Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/JRZQDCBE",
Handler: JRZQ.JRZQDCBEHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/JRZQFEF8",
Handler: JRZQ.JRZQFEF8Handler(serverCtx),
},
}...,
),
rest.WithPrefix("/api/v1"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
Path: "/QYGL2ACD",
Handler: QYGL.QYGL2ACDHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/QYGL45BD",
Handler: QYGL.QYGL45BDHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/QYGL51BC",
Handler: QYGL.QYGL51BCHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/QYGL6F2D",
Handler: QYGL.QYGL6F2DHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/QYGL8261",
Handler: QYGL.QYGL8261Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/QYGLB4C0",
Handler: QYGL.QYGLB4C0Handler(serverCtx),
},
}...,
),
rest.WithPrefix("/api/v1"),
)
server.AddRoutes(
rest.WithMiddlewares(
[]rest.Middleware{serverCtx.ApiAuthInterceptor},
[]rest.Route{
{
Method: http.MethodPost,
Path: "/YYSY09CD",
Handler: YYSY.YYSY09CDHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/YYSY4B37",
Handler: YYSY.YYSY4B37Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/YYSY6F2E",
Handler: YYSY.YYSY6F2EHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/YYSYBE08",
Handler: YYSY.YYSYBE08Handler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/YYSYD50F",
Handler: YYSY.YYSYD50FHandler(serverCtx),
},
{
Method: http.MethodPost,
Path: "/YYSYF7DB",
Handler: YYSY.YYSYF7DBHandler(serverCtx),
},
}...,
),
rest.WithPrefix("/api/v1"),
)
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type FLXG162ALogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewFLXG162ALogic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG162ALogic {
return &FLXG162ALogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *FLXG162ALogic) FLXG162A(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,98 @@
package FLXG
import (
"context"
"encoding/hex"
"errors"
"tianyuan-api/apps/api/internal/validator"
"tianyuan-api/pkg/crypto"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type FLXG3D56Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewFLXG3D56Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG3D56Logic {
return &FLXG3D56Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *FLXG3D56Logic) FLXG3D56(req *types.Request) (resp *types.Response, err error) {
//userId, ok := l.ctx.Value("userId").(int64)
//if !ok {
// return &types.Response{}, errors.New("系统错误,请联系管理员")
//}
secretKey, ok := l.ctx.Value("secretKey").(string)
if !ok {
return &types.Response{}, errors.New("系统错误,请联系管理员")
}
// 1、解密
key, err := hex.DecodeString(secretKey)
decryptData, err := crypto.AesDecrypt(req.Data, key)
if err != nil || len(decryptData) == 0 {
return nil, errors.New("参数解密失败")
}
// 2、校验
var data validator.FLXG3D56Request
if validatorErr := validator.ValidateAndParse(decryptData, &data); validatorErr != nil {
return nil, validatorErr
}
// 3、西部加密
westConfig := l.svcCtx.Config.WestConfig
mobileNo, err := crypto.WestDexEncrypt(data.MobileNo, westConfig.Key)
if err != nil {
logx.Errorf("西部加密错误:%v", err)
return nil, errors.New("业务异常")
}
name, err := crypto.WestDexEncrypt(data.Name, westConfig.Key)
if err != nil {
logx.Errorf("西部加密错误:%v", err)
return nil, errors.New("业务异常")
}
idCard, err := crypto.WestDexEncrypt(data.IDCard, westConfig.Key)
if err != nil {
logx.Errorf("西部加密错误:%v", err)
return nil, errors.New("业务异常")
}
timeRange, err := crypto.WestDexEncrypt(data.TimeRange, westConfig.Key)
if err != nil {
logx.Errorf("西部加密错误:%v", err)
return nil, errors.New("业务异常")
}
// 4、发送请求到西部
westdexRequest := map[string]interface{}{
"id": idCard,
"cell": mobileNo,
"name": name,
"time_range": timeRange,
}
westResp, err := l.svcCtx.WestDexService.CallAPI("G26BJ05", westdexRequest)
if err != nil {
return nil, err
}
// 5、响应解析
//var respData westmodel.G09GX01Response
//unmarshalErr := json.Unmarshal(westResp, &respData)
//if unmarshalErr != nil {
// return nil, unmarshalErr
//}
//crypto.AesEncrypt()
return &types.Response{
Data: string(westResp),
}, nil
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type FLXG54F5Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewFLXG54F5Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG54F5Logic {
return &FLXG54F5Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *FLXG54F5Logic) FLXG54F5(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type FLXG5876Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewFLXG5876Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG5876Logic {
return &FLXG5876Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *FLXG5876Logic) FLXG5876(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type FLXG75FELogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewFLXG75FELogic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG75FELogic {
return &FLXG75FELogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *FLXG75FELogic) FLXG75FE(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type FLXG9687Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewFLXG9687Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG9687Logic {
return &FLXG9687Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *FLXG9687Logic) FLXG9687(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type FLXG970FLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewFLXG970FLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXG970FLogic {
return &FLXG970FLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *FLXG970FLogic) FLXG970F(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type FLXGC9D1Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewFLXGC9D1Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXGC9D1Logic {
return &FLXGC9D1Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *FLXGC9D1Logic) FLXGC9D1(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type FLXGCA3DLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewFLXGCA3DLogic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXGCA3DLogic {
return &FLXGCA3DLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *FLXGCA3DLogic) FLXGCA3D(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package FLXG
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type FLXGDEC7Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewFLXGDEC7Logic(ctx context.Context, svcCtx *svc.ServiceContext) *FLXGDEC7Logic {
return &FLXGDEC7Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *FLXGDEC7Logic) FLXGDEC7(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type IVYZ0B03Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewIVYZ0B03Logic(ctx context.Context, svcCtx *svc.ServiceContext) *IVYZ0B03Logic {
return &IVYZ0B03Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *IVYZ0B03Logic) IVYZ0B03(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type IVYZ2125Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewIVYZ2125Logic(ctx context.Context, svcCtx *svc.ServiceContext) *IVYZ2125Logic {
return &IVYZ2125Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *IVYZ2125Logic) IVYZ2125(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type IVYZ385ELogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewIVYZ385ELogic(ctx context.Context, svcCtx *svc.ServiceContext) *IVYZ385ELogic {
return &IVYZ385ELogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *IVYZ385ELogic) IVYZ385E(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type IVYZ5733Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewIVYZ5733Logic(ctx context.Context, svcCtx *svc.ServiceContext) *IVYZ5733Logic {
return &IVYZ5733Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *IVYZ5733Logic) IVYZ5733(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type IVYZ9363Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewIVYZ9363Logic(ctx context.Context, svcCtx *svc.ServiceContext) *IVYZ9363Logic {
return &IVYZ9363Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *IVYZ9363Logic) IVYZ9363(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package IVYZ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type IVYZADEELogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewIVYZADEELogic(ctx context.Context, svcCtx *svc.ServiceContext) *IVYZADEELogic {
return &IVYZADEELogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *IVYZADEELogic) IVYZADEE(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type JRZQ0A03Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewJRZQ0A03Logic(ctx context.Context, svcCtx *svc.ServiceContext) *JRZQ0A03Logic {
return &JRZQ0A03Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *JRZQ0A03Logic) JRZQ0A03(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type JRZQ4AA8Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewJRZQ4AA8Logic(ctx context.Context, svcCtx *svc.ServiceContext) *JRZQ4AA8Logic {
return &JRZQ4AA8Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *JRZQ4AA8Logic) JRZQ4AA8(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type JRZQ8203Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewJRZQ8203Logic(ctx context.Context, svcCtx *svc.ServiceContext) *JRZQ8203Logic {
return &JRZQ8203Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *JRZQ8203Logic) JRZQ8203(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type JRZQCEE8Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewJRZQCEE8Logic(ctx context.Context, svcCtx *svc.ServiceContext) *JRZQCEE8Logic {
return &JRZQCEE8Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *JRZQCEE8Logic) JRZQCEE8(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type JRZQDCBELogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewJRZQDCBELogic(ctx context.Context, svcCtx *svc.ServiceContext) *JRZQDCBELogic {
return &JRZQDCBELogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *JRZQDCBELogic) JRZQDCBE(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package JRZQ
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type JRZQFEF8Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewJRZQFEF8Logic(ctx context.Context, svcCtx *svc.ServiceContext) *JRZQFEF8Logic {
return &JRZQFEF8Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *JRZQFEF8Logic) JRZQFEF8(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,35 @@
package QYGL
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type QYGL2ACDLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewQYGL2ACDLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QYGL2ACDLogic {
return &QYGL2ACDLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *QYGL2ACDLogic) QYGL2ACD(req *types.Request) (resp *types.Response, err error) {
data := "zhangSan"
err = l.svcCtx.KqPusherClient.Push(l.ctx, data)
if err != nil {
logx.Errorf("KqPusherClient Push Error , err :%v", err)
}
return &types.Response{
Data: "三要素合演",
}, nil
}

View File

@@ -0,0 +1,30 @@
package QYGL
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type QYGL45BDLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewQYGL45BDLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QYGL45BDLogic {
return &QYGL45BDLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *QYGL45BDLogic) QYGL45BD(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package QYGL
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type QYGL51BCLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewQYGL51BCLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QYGL51BCLogic {
return &QYGL51BCLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *QYGL51BCLogic) QYGL51BC(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package QYGL
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type QYGL6F2DLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewQYGL6F2DLogic(ctx context.Context, svcCtx *svc.ServiceContext) *QYGL6F2DLogic {
return &QYGL6F2DLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *QYGL6F2DLogic) QYGL6F2D(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package QYGL
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type QYGL8261Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewQYGL8261Logic(ctx context.Context, svcCtx *svc.ServiceContext) *QYGL8261Logic {
return &QYGL8261Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *QYGL8261Logic) QYGL8261(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package QYGL
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type QYGLB4C0Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewQYGLB4C0Logic(ctx context.Context, svcCtx *svc.ServiceContext) *QYGLB4C0Logic {
return &QYGLB4C0Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *QYGLB4C0Logic) QYGLB4C0(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package YYSY
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type YYSY09CDLogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewYYSY09CDLogic(ctx context.Context, svcCtx *svc.ServiceContext) *YYSY09CDLogic {
return &YYSY09CDLogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *YYSY09CDLogic) YYSY09CD(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package YYSY
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type YYSY4B37Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewYYSY4B37Logic(ctx context.Context, svcCtx *svc.ServiceContext) *YYSY4B37Logic {
return &YYSY4B37Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *YYSY4B37Logic) YYSY4B37(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package YYSY
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type YYSY6F2ELogic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewYYSY6F2ELogic(ctx context.Context, svcCtx *svc.ServiceContext) *YYSY6F2ELogic {
return &YYSY6F2ELogic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *YYSY6F2ELogic) YYSY6F2E(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

View File

@@ -0,0 +1,30 @@
package YYSY
import (
"context"
"tianyuan-api/apps/api/internal/svc"
"tianyuan-api/apps/api/internal/types"
"github.com/zeromicro/go-zero/core/logx"
)
type YYSYBE08Logic struct {
logx.Logger
ctx context.Context
svcCtx *svc.ServiceContext
}
func NewYYSYBE08Logic(ctx context.Context, svcCtx *svc.ServiceContext) *YYSYBE08Logic {
return &YYSYBE08Logic{
Logger: logx.WithContext(ctx),
ctx: ctx,
svcCtx: svcCtx,
}
}
func (l *YYSYBE08Logic) YYSYBE08(req *types.Request) (resp *types.Response, err error) {
// todo: add your logic here and delete this line
return
}

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