@@ -18,7 +18,7 @@ func List(c *gin.Context) {
|
||||
offset, ok := c.GetQuery("offset")
|
||||
if !ok {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusClient).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceList).
|
||||
SetType(exception.TypeCommon).
|
||||
@@ -32,7 +32,7 @@ func List(c *gin.Context) {
|
||||
limitNum, err := strconv.ParseInt(limit, 10, 64)
|
||||
if err != nil {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusClient).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceList).
|
||||
SetType(exception.TypeCommon).
|
||||
@@ -45,7 +45,7 @@ func List(c *gin.Context) {
|
||||
offsetNum, err := strconv.ParseInt(offset, 10, 64)
|
||||
if err != nil {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusClient).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceList).
|
||||
SetType(exception.TypeCommon).
|
||||
|
||||
@@ -44,7 +44,7 @@ func Update(c *gin.Context) {
|
||||
err = c.ShouldBindJSON(&ReqInfo)
|
||||
if err != nil {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusClient).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||
SetType(exception.TypeCommon).
|
||||
@@ -82,7 +82,7 @@ func Update(c *gin.Context) {
|
||||
if ReqInfo.Username != "" {
|
||||
if len(ReqInfo.Username) < 5 || len(ReqInfo.Username) >= 255 {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusClient).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||
SetType(exception.TypeCommon).
|
||||
@@ -97,7 +97,7 @@ func Update(c *gin.Context) {
|
||||
if ReqInfo.Nickname != "" {
|
||||
if utf8.RuneCountInString(ReqInfo.Nickname) > 24 {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusClient).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||
SetType(exception.TypeCommon).
|
||||
@@ -112,7 +112,7 @@ func Update(c *gin.Context) {
|
||||
if ReqInfo.Subtitle != "" {
|
||||
if utf8.RuneCountInString(ReqInfo.Subtitle) > 32 {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusClient).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||
SetType(exception.TypeCommon).
|
||||
@@ -128,7 +128,7 @@ func Update(c *gin.Context) {
|
||||
_, err := url.ParseRequestURI(ReqInfo.Avatar)
|
||||
if err != nil {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusClient).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||
SetType(exception.TypeCommon).
|
||||
@@ -144,7 +144,7 @@ func Update(c *gin.Context) {
|
||||
if ReqInfo.Bio != "" {
|
||||
if !cryptography.IsBase64Std(ReqInfo.Bio) {
|
||||
errorCode := new(exception.Builder).
|
||||
SetStatus(exception.StatusClient).
|
||||
SetStatus(exception.StatusUser).
|
||||
SetService(exception.ServiceUser).
|
||||
SetEndpoint(exception.EndpointUserServiceUpdate).
|
||||
SetType(exception.TypeCommon).
|
||||
|
||||
Reference in New Issue
Block a user