Files
rootandClaude Opus 5 8679200f41 Initial commit
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
2026-09-15 13:57:10 +08:00

38 lines
837 B
Go

package officialWebsiteser
import "91porn-server/models/v/officialWebsitemod"
type PartnerListReq struct{}
type PartnerListResp struct {
Total int64 `json:"total"`
List []PartnerResp `json:"list"`
}
type PartnerResp struct {
Name string `json:"name"`
Description string `json:"description"`
Logo string `json:"logo"`
Url string `json:"url"`
}
func PartnerList(req *PartnerListReq) (resp PartnerListResp, err error) {
data, err := (&officialWebsitemod.Partner{}).FindMany(nil)
if err != nil {
return
}
resp = PartnerListResp{
Total: int64(len(data)),
List: make([]PartnerResp, 0),
}
for _, v := range data {
resp.List = append(resp.List, PartnerResp{
Name: v.Name,
Description: v.Description,
Logo: v.Logo,
Url: v.Url,
})
}
return resp, nil
}