1234567891011121314151617181920212223242526272829303132333435363738394041424344 |
- package credit_balance
- import (
- "net/http"
- "github.com/zeromicro/go-zero/rest/httpx"
- "wechat-api/internal/logic/credit_balance"
- "wechat-api/internal/svc"
- "wechat-api/internal/types"
- )
- // swagger:route post /credit_balance/update credit_balance UpdateCreditBalance
- //
- // Update credit balance information | 更新CreditBalance
- //
- // Update credit balance information | 更新CreditBalance
- //
- // Parameters:
- // + name: body
- // require: true
- // in: body
- // type: CreditBalanceInfo
- //
- // Responses:
- // 200: BaseMsgResp
- func UpdateCreditBalanceHandler(svcCtx *svc.ServiceContext) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- var req types.CreditBalanceInfo
- if err := httpx.Parse(r, &req, true); err != nil {
- httpx.ErrorCtx(r.Context(), w, err)
- return
- }
- l := credit_balance.NewUpdateCreditBalanceLogic(r.Context(), svcCtx)
- resp, err := l.UpdateCreditBalance(&req)
- if err != nil {
- httpx.ErrorCtx(r.Context(), w, err)
- } else {
- httpx.OkJsonCtx(r.Context(), w, resp)
- }
- }
- }
|