MCPcopy Index your code
hub / github.com/aiprodcoder/MIXAPI / TransferAffQuota

Function TransferAffQuota

controller/user.go:349–373  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

347}
348
349func TransferAffQuota(c *gin.Context) {
350 id := c.GetInt("id")
351 user, err := model.GetUserById(id, true)
352 if err != nil {
353 common.ApiError(c, err)
354 return
355 }
356 tran := TransferAffQuotaRequest{}
357 if err := c.ShouldBindJSON(&tran); err != nil {
358 common.ApiError(c, err)
359 return
360 }
361 err = user.TransferAffQuotaToQuota(tran.Quota)
362 if err != nil {
363 c.JSON(http.StatusOK, gin.H{
364 "success": false,
365 "message": "划转失败 " + err.Error(),
366 })
367 return
368 }
369 c.JSON(http.StatusOK, gin.H{
370 "success": true,
371 "message": "划转成功",
372 })
373}
374
375func GetAffCode(c *gin.Context) {
376 id := c.GetInt("id")

Callers

nothing calls this directly

Calls 4

GetUserByIdFunction · 0.92
ApiErrorFunction · 0.92
ErrorMethod · 0.80

Tested by

no test coverage detected