You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
477 B
21 lines
477 B
package web
|
|
|
|
import (
|
|
"github.com/gin-gonic/gin"
|
|
"goskeleton/app/global/consts"
|
|
"goskeleton/app/service/ai_model_cli"
|
|
"goskeleton/app/utils/response"
|
|
)
|
|
|
|
type StyleGenerate struct {
|
|
}
|
|
|
|
// ai生成样式
|
|
func (s *StyleGenerate) StyleGenerate(c *gin.Context) {
|
|
if res, err := ai_model_cli.RequestStyle(c); err==nil {
|
|
response.Success(c, consts.CurdStatusOkMsg, res.(string))
|
|
} else {
|
|
response.Fail(c, consts.StyleGenerateFailCode, consts.StyleGenerateFailMsg, err)
|
|
}
|
|
}
|