mirror of
https://github.com/KaySar12/NextZen-UserService.git
synced 2025-03-15 23:25:35 +07:00
wip (#15)
This commit is contained in:
parent
58ce3d1210
commit
71e4f36c42
@ -421,7 +421,18 @@ func PostUserCustomConf(c *gin.Context) {
|
||||
data, _ := io.ReadAll(c.Request.Body)
|
||||
filePath := config.AppInfo.UserDataPath + "/" + strconv.Itoa(user.Id)
|
||||
|
||||
file.WriteToPath(data, filePath, name+".json")
|
||||
if err := file.IsNotExistMkDir(filePath); err != nil {
|
||||
c.JSON(common_err.SERVICE_ERROR,
|
||||
model.Result{Success: common_err.SERVICE_ERROR, Message: common_err.GetMsg(common_err.SERVICE_ERROR)})
|
||||
return
|
||||
}
|
||||
|
||||
if err := file.WriteToPath(data, filePath, name+".json"); err != nil {
|
||||
c.JSON(common_err.SERVICE_ERROR,
|
||||
model.Result{Success: common_err.SERVICE_ERROR, Message: common_err.GetMsg(common_err.SERVICE_ERROR)})
|
||||
return
|
||||
}
|
||||
|
||||
c.JSON(common_err.SUCCESS, model.Result{Success: common_err.SUCCESS, Message: common_err.GetMsg(common_err.SUCCESS), Data: json2.RawMessage(string(data))})
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user