package avatar

import (
	"net/http"

	"github.com/zeromicro/go-zero/rest/httpx"

	"wechat-api/internal/logic/avatar"
	"wechat-api/internal/svc"
)

// swagger:route post /api/avatar/sts avatar GetAcsResponse
//
// get avatar configuration | 获取数字人配置信息
//
// get avatar configuration | 获取数字人配置信息
//
// Responses:
//  200: AvatarStsResp

func GetAcsResponseHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
	return func(w http.ResponseWriter, r *http.Request) {
		l := avatar.NewGetAcsResponseLogic(r.Context(), svcCtx)
		resp, err := l.GetAcsResponse()
		if err != nil {
			httpx.ErrorCtx(r.Context(), w, err)
		} else {
			httpx.OkJsonCtx(r.Context(), w, resp)
		}
	}
}
