This commit is contained in:
2026-07-24 10:40:33 +08:00
parent 8b3c64721a
commit fc1e880fcc
23 changed files with 97 additions and 56 deletions
+2 -2
View File
@@ -38,9 +38,9 @@ func RouteRegister(controllers []interface{}) {
for _, t := range controllers {
sName := reflect.ValueOf(t).Elem().Type().Name()
convertedStr := re.ReplaceAllStringFunc(sName, func(s string) string {
return fmt.Sprintf("/%s", strings.ToLower(s))
return fmt.Sprintf("-%s", strings.ToLower(s))
})
if len(convertedStr) > 0 && convertedStr[0] == '/' {
if len(convertedStr) > 0 && convertedStr[0] == '-' {
convertedStr = convertedStr[1:]
}
Httpserver.Group("/"+convertedStr, func(group *ghttp.RouterGroup) {
BIN
View File
Binary file not shown.
+4 -4
View File
@@ -10,7 +10,7 @@ type bgm struct{}
var Bgm = new(bgm)
func (c *bgm) ListBackgroundMusic(ctx context.Context, req *dto.ListBackgroundMusicReq) (res *dto.ListBackgroundMusicRes, err error) {
func (c *bgm) List(ctx context.Context, req *dto.ListBackgroundMusicReq) (res *dto.ListBackgroundMusicRes, err error) {
list, err := service.BgmService.ListBackgroundMusic(ctx, req.DramaId)
if err != nil {
return nil, err
@@ -18,7 +18,7 @@ func (c *bgm) ListBackgroundMusic(ctx context.Context, req *dto.ListBackgroundMu
return &dto.ListBackgroundMusicRes{List: list}, nil
}
func (c *bgm) AddBackgroundMusic(ctx context.Context, req *dto.AddBackgroundMusicReq) (res *dto.GetDramaRes, err error) {
func (c *bgm) Add(ctx context.Context, req *dto.AddBackgroundMusicReq) (res *dto.GetDramaRes, err error) {
var filePath string
if req.AudioFile != nil {
f, err := req.AudioFile.Open()
@@ -38,7 +38,7 @@ func (c *bgm) AddBackgroundMusic(ctx context.Context, req *dto.AddBackgroundMusi
return nil, nil
}
func (c *bgm) UpdateBackgroundMusic(ctx context.Context, req *dto.UpdateBackgroundMusicReq) (res *dto.GetDramaRes, err error) {
func (c *bgm) Update(ctx context.Context, req *dto.UpdateBackgroundMusicReq) (res *dto.GetDramaRes, err error) {
var filePath string
if req.AudioFile != nil {
f, err := req.AudioFile.Open()
@@ -58,7 +58,7 @@ func (c *bgm) UpdateBackgroundMusic(ctx context.Context, req *dto.UpdateBackgrou
return nil, nil
}
func (c *bgm) DeleteBackgroundMusic(ctx context.Context, req *dto.DeleteBackgroundMusicReq) (res *dto.GetDramaRes, err error) {
func (c *bgm) Delete(ctx context.Context, req *dto.DeleteBackgroundMusicReq) (res *dto.GetDramaRes, err error) {
err = service.BgmService.DeleteBackgroundMusic(ctx, req.Id)
if err != nil {
return nil, err
@@ -10,7 +10,7 @@ type character struct{}
var Character = new(character)
func (c *character) ListCharacter(ctx context.Context, req *dto.ListCharacterReq) (res *dto.ListCharacterRes, err error) {
func (c *character) List(ctx context.Context, req *dto.ListCharacterReq) (res *dto.ListCharacterRes, err error) {
list, err := service.CharacterService.ListCharacter(ctx, req.DramaId)
if err != nil {
return nil, err
@@ -18,7 +18,7 @@ func (c *character) ListCharacter(ctx context.Context, req *dto.ListCharacterReq
return &dto.ListCharacterRes{List: list}, nil
}
func (c *character) AddCharacter(ctx context.Context, req *dto.AddCharacterReq) (res *dto.GetDramaRes, err error) {
func (c *character) Add(ctx context.Context, req *dto.AddCharacterReq) (res *dto.GetDramaRes, err error) {
var voicePath, portraitPath string
if req.VoiceFile != nil {
f, err := req.VoiceFile.Open()
@@ -55,7 +55,7 @@ func (c *character) AddCharacter(ctx context.Context, req *dto.AddCharacterReq)
return nil, nil
}
func (c *character) UpdateCharacter(ctx context.Context, req *dto.UpdateCharacterReq) (res *dto.GetDramaRes, err error) {
func (c *character) Update(ctx context.Context, req *dto.UpdateCharacterReq) (res *dto.GetDramaRes, err error) {
var voicePath, portraitPath string
if req.VoiceFile != nil {
f, err := req.VoiceFile.Open()
@@ -92,7 +92,7 @@ func (c *character) UpdateCharacter(ctx context.Context, req *dto.UpdateCharacte
return nil, nil
}
func (c *character) DeleteCharacter(ctx context.Context, req *dto.DeleteCharacterReq) (res *dto.GetDramaRes, err error) {
func (c *character) Delete(ctx context.Context, req *dto.DeleteCharacterReq) (res *dto.GetDramaRes, err error) {
err = service.CharacterService.DeleteCharacter(ctx, req.DramaId, req.CharId)
if err != nil {
return nil, err
+4 -4
View File
@@ -10,7 +10,7 @@ type episode struct{}
var Episode = new(episode)
func (c *episode) ListEpisode(ctx context.Context, req *dto.ListEpisodeReq) (res *dto.ListEpisodeRes, err error) {
func (c *episode) List(ctx context.Context, req *dto.ListEpisodeReq) (res *dto.ListEpisodeRes, err error) {
list, total, err := service.EpisodeService.ListEpisode(ctx, req.DramaId, req.Page, req.PageSize, req.Keyword)
if err != nil {
return nil, err
@@ -18,7 +18,7 @@ func (c *episode) ListEpisode(ctx context.Context, req *dto.ListEpisodeReq) (res
return &dto.ListEpisodeRes{List: list, Total: total, Page: req.Page, PageSize: req.PageSize}, nil
}
func (c *episode) AddEpisode(ctx context.Context, req *dto.AddEpisodeReq) (res *dto.GetDramaRes, err error) {
func (c *episode) Add(ctx context.Context, req *dto.AddEpisodeReq) (res *dto.GetDramaRes, err error) {
_, err = service.EpisodeService.AddEpisode(ctx, req.DramaId, req.Title, req.Description, req.Script, req.Index)
if err != nil {
return nil, err
@@ -26,7 +26,7 @@ func (c *episode) AddEpisode(ctx context.Context, req *dto.AddEpisodeReq) (res *
return nil, nil
}
func (c *episode) UpdateEpisode(ctx context.Context, req *dto.UpdateEpisodeReq) (res *dto.GetDramaRes, err error) {
func (c *episode) Update(ctx context.Context, req *dto.UpdateEpisodeReq) (res *dto.GetDramaRes, err error) {
err = service.EpisodeService.UpdateEpisode(ctx, req.DramaId, req.EpId, req.Title, req.Description, req.Script, req.Index)
if err != nil {
return nil, err
@@ -42,7 +42,7 @@ func (c *episode) GenerateScript(ctx context.Context, req *dto.GenerateScriptReq
return &dto.GenerateScriptRes{Script: script}, nil
}
func (c *episode) DeleteEpisode(ctx context.Context, req *dto.DeleteEpisodeReq) (res *dto.GetDramaRes, err error) {
func (c *episode) Delete(ctx context.Context, req *dto.DeleteEpisodeReq) (res *dto.GetDramaRes, err error) {
err = service.EpisodeService.DeleteEpisode(ctx, req.DramaId, req.EpId)
if err != nil {
return nil, err
+4 -4
View File
@@ -10,7 +10,7 @@ type prop struct{}
var Prop = new(prop)
func (c *prop) ListProp(ctx context.Context, req *dto.ListPropReq) (res *dto.ListPropRes, err error) {
func (c *prop) List(ctx context.Context, req *dto.ListPropReq) (res *dto.ListPropRes, err error) {
list, err := service.PropService.ListProp(ctx, req.DramaId)
if err != nil {
return nil, err
@@ -18,7 +18,7 @@ func (c *prop) ListProp(ctx context.Context, req *dto.ListPropReq) (res *dto.Lis
return &dto.ListPropRes{List: list}, nil
}
func (c *prop) AddProp(ctx context.Context, req *dto.AddPropReq) (res *dto.GetDramaRes, err error) {
func (c *prop) Add(ctx context.Context, req *dto.AddPropReq) (res *dto.GetDramaRes, err error) {
var imagePath string
if req.ImageFile != nil {
f, err := req.ImageFile.Open()
@@ -41,7 +41,7 @@ func (c *prop) AddProp(ctx context.Context, req *dto.AddPropReq) (res *dto.GetDr
return nil, nil
}
func (c *prop) UpdateProp(ctx context.Context, req *dto.UpdatePropReq) (res *dto.GetDramaRes, err error) {
func (c *prop) Update(ctx context.Context, req *dto.UpdatePropReq) (res *dto.GetDramaRes, err error) {
var imagePath string
if req.ImageFile != nil {
f, err := req.ImageFile.Open()
@@ -64,7 +64,7 @@ func (c *prop) UpdateProp(ctx context.Context, req *dto.UpdatePropReq) (res *dto
return nil, nil
}
func (c *prop) DeleteProp(ctx context.Context, req *dto.DeletePropReq) (res *dto.GetDramaRes, err error) {
func (c *prop) Delete(ctx context.Context, req *dto.DeletePropReq) (res *dto.GetDramaRes, err error) {
err = service.PropService.DeleteProp(ctx, req.Id)
if err != nil {
return nil, err
+4 -4
View File
@@ -10,7 +10,7 @@ type scene struct{}
var Scene = new(scene)
func (c *scene) ListScene(ctx context.Context, req *dto.ListSceneReq) (res *dto.ListSceneRes, err error) {
func (c *scene) List(ctx context.Context, req *dto.ListSceneReq) (res *dto.ListSceneRes, err error) {
list, err := service.SceneService.ListScene(ctx, req.DramaId)
if err != nil {
return nil, err
@@ -18,7 +18,7 @@ func (c *scene) ListScene(ctx context.Context, req *dto.ListSceneReq) (res *dto.
return &dto.ListSceneRes{List: list}, nil
}
func (c *scene) AddScene(ctx context.Context, req *dto.AddSceneReq) (res *dto.GetDramaRes, err error) {
func (c *scene) Add(ctx context.Context, req *dto.AddSceneReq) (res *dto.GetDramaRes, err error) {
var imagePath string
if req.ImageFile != nil {
f, err := req.ImageFile.Open()
@@ -41,7 +41,7 @@ func (c *scene) AddScene(ctx context.Context, req *dto.AddSceneReq) (res *dto.Ge
return nil, nil
}
func (c *scene) UpdateScene(ctx context.Context, req *dto.UpdateSceneReq) (res *dto.GetDramaRes, err error) {
func (c *scene) Update(ctx context.Context, req *dto.UpdateSceneReq) (res *dto.GetDramaRes, err error) {
var imagePath string
if req.ImageFile != nil {
f, err := req.ImageFile.Open()
@@ -64,7 +64,7 @@ func (c *scene) UpdateScene(ctx context.Context, req *dto.UpdateSceneReq) (res *
return nil, nil
}
func (c *scene) DeleteScene(ctx context.Context, req *dto.DeleteSceneReq) (res *dto.GetDramaRes, err error) {
func (c *scene) Delete(ctx context.Context, req *dto.DeleteSceneReq) (res *dto.GetDramaRes, err error) {
err = service.SceneService.DeleteScene(ctx, req.Id)
if err != nil {
return nil, err
@@ -1,13 +1,19 @@
package dto
import "video-factory/shortdrama/model/entity"
import (
"video-factory/shortdrama/model/entity"
"github.com/gogf/gf/v2/frame/g"
)
type RechargeReq struct {
g.Meta `path:"/recharge" method:"post" tags:"短剧管理" summary:"充值"`
UserId int64 `json:"user_id"`
Amount int64 `json:"amount"`
}
type ListTransactionReq struct {
g.Meta `path:"/list" method:"get" tags:"短剧管理" summary:"交易记录"`
UserId int64 `json:"user_id"`
Type string `json:"type"` // 筛选类型:recharge/deduct/空(全部)
Page int `json:"page"`
+10 -1
View File
@@ -1,8 +1,13 @@
package dto
import "video-factory/shortdrama/model/entity"
import (
"video-factory/shortdrama/model/entity"
"github.com/gogf/gf/v2/frame/g"
)
type CreateAgentReq struct {
g.Meta `path:"/create" method:"post" tags:"短剧管理" summary:"创建代理商"`
Username string `v:"required|length:5,18|regex:^[a-zA-Z][a-zA-Z0-9_]+$" json:"username"`
Password string `v:"required|length:6,18|password-complex" json:"password"`
Phone string `v:"required|phone" json:"phone"`
@@ -13,6 +18,7 @@ type CreateAgentReq struct {
}
type ListAgentReq struct {
g.Meta `path:"/list" method:"get" tags:"短剧管理" summary:"代理商列表"`
Page int `json:"page"`
PageSize int `json:"page_size"`
Keyword string `json:"keyword"`
@@ -37,6 +43,7 @@ type ListAgentRes struct {
}
type UpdateAgentReq struct {
g.Meta `path:"/update" method:"post" tags:"短剧管理" summary:"更新代理商"`
Id int64 `v:"required" json:"id"`
Phone string `json:"phone"`
Name string `v:"required" json:"name"`
@@ -45,6 +52,7 @@ type UpdateAgentReq struct {
}
type RenewAgentReq struct {
g.Meta `path:"/renew" method:"post" tags:"短剧管理" summary:"续费代理商"`
AgentId int64 `v:"required" json:"agent_id"`
}
@@ -60,6 +68,7 @@ type RenewalRecord struct {
}
type ListRenewalsReq struct {
g.Meta `path:"/list-renewals" method:"get" tags:"短剧管理" summary:"代理商续费记录"`
AgentId int64 `v:"required" json:"agent_id"`
}
+4 -4
View File
@@ -8,7 +8,7 @@ import (
)
type ListBackgroundMusicReq struct {
g.Meta `path:"/background-music/list" method:"get" tags:"短剧管理" summary:"背景音列表"`
g.Meta `path:"/list" method:"get" tags:"短剧管理" summary:"背景音列表"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
}
@@ -17,14 +17,14 @@ type ListBackgroundMusicRes struct {
}
type AddBackgroundMusicReq struct {
g.Meta `path:"/background-music/add" method:"post" tags:"短剧管理" summary:"添加背景音"`
g.Meta `path:"/add" method:"post" tags:"短剧管理" summary:"添加背景音"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
Name string `v:"required" json:"name" dc:"背景音名称"`
AudioFile *ghttp.UploadFile `json:"audioFile" dc:"背景音文件"`
}
type UpdateBackgroundMusicReq struct {
g.Meta `path:"/background-music/update" method:"post" tags:"短剧管理" summary:"更新背景音"`
g.Meta `path:"/update" method:"post" tags:"短剧管理" summary:"更新背景音"`
Id int64 `json:"id" dc:"背景音ID"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
Name string `v:"required" json:"name" dc:"背景音名称"`
@@ -32,7 +32,7 @@ type UpdateBackgroundMusicReq struct {
}
type DeleteBackgroundMusicReq struct {
g.Meta `path:"/background-music/delete" method:"post" tags:"短剧管理" summary:"删除背景音"`
g.Meta `path:"/delete" method:"post" tags:"短剧管理" summary:"删除背景音"`
Id int64 `json:"id" dc:"背景音ID"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
}
+4 -4
View File
@@ -8,7 +8,7 @@ import (
)
type ListCharacterReq struct {
g.Meta `path:"/character/list" method:"get" tags:"短剧管理" summary:"演员列表"`
g.Meta `path:"/list" method:"get" tags:"短剧管理" summary:"演员列表"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
}
@@ -17,7 +17,7 @@ type ListCharacterRes struct {
}
type AddCharacterReq struct {
g.Meta `path:"/character/add" method:"post" tags:"短剧管理" summary:"添加演员"`
g.Meta `path:"/add" method:"post" tags:"短剧管理" summary:"添加演员"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
Name string `v:"required" json:"name" dc:"演员名称"`
Description string `v:"required" json:"description" dc:"演员描述"`
@@ -26,7 +26,7 @@ type AddCharacterReq struct {
}
type UpdateCharacterReq struct {
g.Meta `path:"/character/update" method:"post" tags:"短剧管理" summary:"更新演员"`
g.Meta `path:"/update" method:"post" tags:"短剧管理" summary:"更新演员"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
CharId int64 `json:"charId" dc:"演员ID"`
Name string `v:"required" json:"name" dc:"演员名称"`
@@ -36,7 +36,7 @@ type UpdateCharacterReq struct {
}
type DeleteCharacterReq struct {
g.Meta `path:"/character/delete" method:"post" tags:"短剧管理" summary:"删除演员"`
g.Meta `path:"/delete" method:"post" tags:"短剧管理" summary:"删除演员"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
CharId int64 `json:"charId" dc:"演员ID"`
}
+8 -1
View File
@@ -1,8 +1,13 @@
package dto
import "video-factory/shortdrama/model/entity"
import (
"video-factory/shortdrama/model/entity"
"github.com/gogf/gf/v2/frame/g"
)
type CreateCustomerReq struct {
g.Meta `path:"/create" method:"post" tags:"短剧管理" summary:"创建客户"`
Phone string `v:"required" json:"phone"`
Name string `v:"required" json:"name"`
Address string `v:"required" json:"address"`
@@ -10,6 +15,7 @@ type CreateCustomerReq struct {
}
type ListCustomerReq struct {
g.Meta `path:"/list" method:"get" tags:"短剧管理" summary:"客户列表"`
AgentId int64 `json:"agent_id"`
Page int `json:"page"`
PageSize int `json:"page_size"`
@@ -47,6 +53,7 @@ type CustomerDetail struct {
}
type UpdateCustomerReq struct {
g.Meta `path:"/update" method:"post" tags:"短剧管理" summary:"更新客户"`
Id int64 `v:"required" json:"id"`
Phone string `json:"phone"`
Name string `json:"name"`
+1 -1
View File
@@ -26,7 +26,7 @@ type ListDramaRes struct {
// ==================== 剧集分页 ====================
type ListEpisodeReq struct {
g.Meta `path:"/episode/list" method:"get" tags:"短剧管理" summary:"剧集列表"`
g.Meta `path:"/list" method:"get" tags:"短剧管理" summary:"剧集列表"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
Page int `json:"page" dc:"页码,从1开始"`
PageSize int `json:"pageSize" dc:"每页条数"`
+6 -6
View File
@@ -7,7 +7,7 @@ import (
)
type AddEpisodeReq struct {
g.Meta `path:"/episode/add" method:"post" tags:"短剧管理" summary:"添加剧集"`
g.Meta `path:"/add" method:"post" tags:"短剧管理" summary:"添加剧集"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
Title string `v:"required" json:"title" dc:"剧集标题"`
Description string `v:"required" json:"description" dc:"剧情描述"`
@@ -16,7 +16,7 @@ type AddEpisodeReq struct {
}
type UpdateEpisodeReq struct {
g.Meta `path:"/episode/update" method:"post" tags:"短剧管理" summary:"更新剧集"`
g.Meta `path:"/update" method:"post" tags:"短剧管理" summary:"更新剧集"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
EpId int64 `json:"epId" dc:"剧集ID"`
Title string `v:"required" json:"title" dc:"剧集标题"`
@@ -26,20 +26,20 @@ type UpdateEpisodeReq struct {
}
type DeleteEpisodeReq struct {
g.Meta `path:"/episode/delete" method:"post" tags:"短剧管理" summary:"删除剧集"`
g.Meta `path:"/delete" method:"post" tags:"短剧管理" summary:"删除剧集"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
EpId int64 `json:"epId" dc:"剧集ID"`
}
type GenerateEpisodeReq struct {
g.Meta `path:"/episode/generate" method:"post" tags:"短剧管理" summary:"单集生成视频"`
g.Meta `path:"/generate" method:"post" tags:"短剧管理" summary:"单集生成视频"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
EpId int64 `json:"epId" dc:"剧集ID"`
Mode string `json:"mode" dc:"生成模式(parallel/serial)"`
}
type EpisodePollReq struct {
g.Meta `path:"/episode/poll" method:"get" tags:"短剧管理" summary:"轮询剧集生成状态(走缓存)"`
g.Meta `path:"/poll" method:"get" tags:"短剧管理" summary:"轮询剧集生成状态"`
EpId int64 `json:"epId" dc:"剧集ID"`
}
@@ -51,7 +51,7 @@ type EpisodePollRes struct {
}
type GenerateScriptReq struct {
g.Meta `path:"/episode/generate-script" method:"post" tags:"短剧管理" summary:"生成剧集脚本"`
g.Meta `path:"/generate-script" method:"post" tags:"短剧管理" summary:"生成剧集脚本"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
Title string `v:"required" json:"title" dc:"剧集标题"`
Description string `v:"required" json:"description" dc:"剧情描述"`
+2 -2
View File
@@ -9,7 +9,7 @@ import (
// GetModelConfigListReq 获取模型配置列表(分页)
type GetModelConfigListReq struct {
g.Meta `path:"/model-list" method:"get" tags:"模型配置" summary:"获取模型配置列表"`
g.Meta `path:"/get-model-list" method:"get" tags:"模型配置" summary:"获取模型配置列表"`
Page int `json:"page" dc:"页码,默认1"`
PageSize int `json:"pageSize" dc:"每页条数,默认20"`
ModelType string `json:"modelType" dc:"模型类型筛选: chat/video"`
@@ -23,7 +23,7 @@ type GetModelConfigListRes struct {
// SaveModelConfigReq 保存单个模型配置
type SaveModelConfigReq struct {
g.Meta `path:"/model" method:"post" tags:"模型配置" summary:"保存模型配置"`
g.Meta `path:"/save-model-config" method:"post" tags:"模型配置" summary:"保存模型配置"`
Id int64 `json:"id"`
ModelType string `json:"modelType" v:"required" dc:"chat=对话模型 video=视频模型"`
ModelName string `json:"modelName" v:"required" dc:"模型名称"`
@@ -1,5 +1,8 @@
package dto
import "github.com/gogf/gf/v2/frame/g"
type ListChannelTradeReq struct {
g.Meta `path:"/list-by-order" method:"get" tags:"短剧管理" summary:"渠道交易记录"`
OrderId int64 `json:"order_id"`
}
+2 -2
View File
@@ -7,7 +7,7 @@ import (
)
type GetPaymentConfigReq struct {
g.Meta `path:"/payment" method:"get" tags:"支付配置" summary:"获取支付配置"`
g.Meta `path:"/get" method:"get" tags:"支付配置" summary:"获取支付配置"`
}
type PaymentTypeConfig struct {
@@ -25,7 +25,7 @@ type GetPaymentConfigRes struct {
}
type SavePaymentConfigReq struct {
g.Meta `path:"/payment" method:"post" tags:"支付配置" summary:"保存支付配置"`
g.Meta `path:"/save" method:"post" tags:"支付配置" summary:"保存支付配置"`
Channel string `json:"channel" v:"required" dc:"支付渠道: wechat/alipay/offline"`
ChannelType string `json:"channelType" dc:"支付类型: jsapi/h5/app/native/manual"`
AppId string `json:"appId"`
@@ -1,6 +1,9 @@
package dto
import "github.com/gogf/gf/v2/frame/g"
type PrepayReq struct {
g.Meta `path:"/prepay" method:"post" tags:"短剧管理" summary:"预支付"`
Amount int64 `v:"required|min:1" json:"amount"`
Channel string `v:"required|in:wechat,alipay,offline" json:"channel"`
OrderType string `json:"order_type" dc:"recharge / renewal"`
@@ -16,6 +19,7 @@ type PrepayRes struct {
}
type PaymentStatusReq struct {
g.Meta `path:"/status" method:"get" tags:"短剧管理" summary:"支付状态查询"`
OrderNo string `json:"order_no"`
}
@@ -26,6 +30,7 @@ type PaymentStatusRes struct {
}
type ConfirmOfflineReq struct {
g.Meta `path:"/confirm-offline" method:"post" tags:"短剧管理" summary:"线下确认支付"`
OrderNo string `v:"required" json:"order_no"`
}
@@ -35,6 +40,7 @@ type ConfirmOfflineRes struct {
}
type CreateRenewOrderReq struct {
g.Meta `path:"/create-renew-order" method:"post" tags:"短剧管理" summary:"创建续费订单"`
AgentId int64 `v:"required" json:"agent_id"`
Duration int `v:"required|min:1" json:"duration" dc:"续费年数"`
PricingId int64 `json:"pricing_id" dc:"地区定价ID(为空则用代理商当前定价)"`
+4 -4
View File
@@ -8,7 +8,7 @@ import (
)
type ListPropReq struct {
g.Meta `path:"/prop/list" method:"get" tags:"短剧管理" summary:"道具列表"`
g.Meta `path:"/list" method:"get" tags:"短剧管理" summary:"道具列表"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
}
@@ -17,7 +17,7 @@ type ListPropRes struct {
}
type AddPropReq struct {
g.Meta `path:"/prop/add" method:"post" tags:"短剧管理" summary:"添加道具"`
g.Meta `path:"/add" method:"post" tags:"短剧管理" summary:"添加道具"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
Name string `v:"required" json:"name" dc:"道具名称"`
Description string `v:"required" json:"description" dc:"道具描述"`
@@ -25,7 +25,7 @@ type AddPropReq struct {
}
type UpdatePropReq struct {
g.Meta `path:"/prop/update" method:"post" tags:"短剧管理" summary:"更新道具"`
g.Meta `path:"/update" method:"post" tags:"短剧管理" summary:"更新道具"`
Id int64 `json:"id" dc:"道具ID"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
Name string `v:"required" json:"name" dc:"道具名称"`
@@ -34,7 +34,7 @@ type UpdatePropReq struct {
}
type DeletePropReq struct {
g.Meta `path:"/prop/delete" method:"post" tags:"短剧管理" summary:"删除道具"`
g.Meta `path:"/delete" method:"post" tags:"短剧管理" summary:"删除道具"`
Id int64 `json:"id" dc:"道具ID"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
}
+7 -1
View File
@@ -1,8 +1,13 @@
package dto
import "video-factory/shortdrama/model/entity"
import (
"video-factory/shortdrama/model/entity"
"github.com/gogf/gf/v2/frame/g"
)
type ListRegionPricingReq struct {
g.Meta `path:"/list" method:"get" tags:"短剧管理" summary:"地区定价列表"`
Page int `json:"page" dc:"页码,默认1"`
PageSize int `json:"pageSize" dc:"每页条数,默认20"`
Keyword string `json:"keyword" dc:"地区名称关键词"`
@@ -15,6 +20,7 @@ type ListRegionPricingRes struct {
}
type SaveRegionPricingReq struct {
g.Meta `path:"/save" method:"post" tags:"短剧管理" summary:"保存地区定价"`
Id int64 `json:"id"`
Province string `v:"required" json:"province"`
Region string `v:"required" json:"region"`
+4 -4
View File
@@ -8,7 +8,7 @@ import (
)
type ListSceneReq struct {
g.Meta `path:"/scene/list" method:"get" tags:"短剧管理" summary:"场景列表"`
g.Meta `path:"/list" method:"get" tags:"短剧管理" summary:"场景列表"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
}
@@ -17,7 +17,7 @@ type ListSceneRes struct {
}
type AddSceneReq struct {
g.Meta `path:"/scene/add" method:"post" tags:"短剧管理" summary:"添加场景"`
g.Meta `path:"/add" method:"post" tags:"短剧管理" summary:"添加场景"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
Name string `v:"required" json:"name" dc:"场景名称"`
Description string `v:"required" json:"description" dc:"场景描述"`
@@ -25,7 +25,7 @@ type AddSceneReq struct {
}
type UpdateSceneReq struct {
g.Meta `path:"/scene/update" method:"post" tags:"短剧管理" summary:"更新场景"`
g.Meta `path:"/update" method:"post" tags:"短剧管理" summary:"更新场景"`
Id int64 `json:"id" dc:"场景ID"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
Name string `v:"required" json:"name" dc:"场景名称"`
@@ -34,7 +34,7 @@ type UpdateSceneReq struct {
}
type DeleteSceneReq struct {
g.Meta `path:"/scene/delete" method:"post" tags:"短剧管理" summary:"删除场景"`
g.Meta `path:"/delete" method:"post" tags:"短剧管理" summary:"删除场景"`
Id int64 `json:"id" dc:"场景ID"`
DramaId int64 `json:"dramaId" dc:"短剧ID"`
}
+4
View File
@@ -1,6 +1,9 @@
package dto
import "github.com/gogf/gf/v2/frame/g"
type LoginReq struct {
g.Meta `path:"/login" method:"post" tags:"短剧管理" summary:"用户登录"`
Account string `v:"required" json:"account"`
Password string `v:"required" json:"password"`
}
@@ -22,6 +25,7 @@ type LoginUser struct {
}
type ChangePasswordReq struct {
g.Meta `path:"/change-password" method:"post" tags:"短剧管理" summary:"修改密码"`
OldPassword string `json:"old_password"`
NewPassword string `json:"new_password"`
}
@@ -7,7 +7,7 @@ import (
)
type GetUserModelConfigReq struct {
g.Meta `path:"/user-model" method:"get" tags:"模型配置" summary:"获取用户模型配置"`
g.Meta `path:"/get-user-config" method:"get" tags:"模型配置" summary:"获取用户模型配置"`
ModelType string `json:"modelType" dc:"模型类型(chat/video),为空时返回首个活跃配置"`
}
@@ -28,13 +28,13 @@ type SaveUserModelConfigItem struct {
}
type SaveUserModelConfigReq struct {
g.Meta `path:"/user-model" method:"post" tags:"模型配置" summary:"批量保存用户模型配置"`
g.Meta `path:"/save-user-config" method:"post" tags:"模型配置" summary:"批量保存用户模型配置"`
Configs []*SaveUserModelConfigItem `json:"configs" dc:"模型配置列表"`
}
// GetUserModelListReq 获取用户模型配置列表(分页)
type GetUserModelListReq struct {
g.Meta `path:"/user-model-list" method:"get" tags:"模型配置" summary:"获取系统模型列表及用户配置状态"`
g.Meta `path:"/get-user-model-list" method:"get" tags:"模型配置" summary:"获取系统模型列表及用户配置状态"`
Page int `json:"page" dc:"页码,默认1"`
PageSize int `json:"pageSize" dc:"每页条数,默认20"`
ModelType string `json:"modelType" dc:"模型类型筛选: chat/video"`