28 lines
921 B
Go
28 lines
921 B
Go
package controller
|
|
|
|
import (
|
|
"context"
|
|
|
|
"slogan-agent/common"
|
|
"slogan-agent/styleagent/model/dto"
|
|
"slogan-agent/styleagent/service"
|
|
|
|
"github.com/gogf/gf/v2/frame/g"
|
|
)
|
|
|
|
type user_photo struct{}
|
|
|
|
var UserPhoto = new(user_photo)
|
|
|
|
func (c *user_photo) Upload(ctx context.Context, req *dto.UserPhotoUploadReq) (res *dto.UserPhotoUploadRes, err error) {
|
|
return service.UserPhotoService.Upload(ctx, common.GetUserId(g.RequestFromCtx(ctx)), req, g.RequestFromCtx(ctx).GetUploadFile("file"))
|
|
}
|
|
|
|
func (c *user_photo) List(ctx context.Context, req *dto.UserPhotoListReq) (res *dto.UserPhotoListRes, err error) {
|
|
return service.UserPhotoService.List(ctx, common.GetUserId(g.RequestFromCtx(ctx)), req.Type)
|
|
}
|
|
|
|
func (c *user_photo) Delete(ctx context.Context, req *dto.UserPhotoDeleteReq) (res *dto.UserPhotoDeleteRes, err error) {
|
|
return service.UserPhotoService.Delete(ctx, common.GetUserId(g.RequestFromCtx(ctx)), req.Id)
|
|
}
|