|
@@ -16,7 +16,7 @@ import (
|
|
"youngee_m_api/util"
|
|
"youngee_m_api/util"
|
|
)
|
|
)
|
|
|
|
|
|
-//GetUser 查找用户,查不到返回空
|
|
|
|
|
|
+// GetUser 查找用户,查不到返回空
|
|
func GetUser(ctx context.Context, User string) (*gorm_model.YounggeeUser, error) {
|
|
func GetUser(ctx context.Context, User string) (*gorm_model.YounggeeUser, error) {
|
|
db := GetReadDB(ctx)
|
|
db := GetReadDB(ctx)
|
|
user := &gorm_model.YounggeeUser{}
|
|
user := &gorm_model.YounggeeUser{}
|
|
@@ -31,7 +31,7 @@ func GetUser(ctx context.Context, User string) (*gorm_model.YounggeeUser, error)
|
|
return user, nil
|
|
return user, nil
|
|
}
|
|
}
|
|
|
|
|
|
-//GetUserByID 查不到返回空
|
|
|
|
|
|
+// GetUserByID 查不到返回空
|
|
func GetUserByID(ctx context.Context, ID int64) (*gorm_model.YounggeeUser, error) {
|
|
func GetUserByID(ctx context.Context, ID int64) (*gorm_model.YounggeeUser, error) {
|
|
db := GetReadDB(ctx)
|
|
db := GetReadDB(ctx)
|
|
user := &gorm_model.YounggeeUser{}
|
|
user := &gorm_model.YounggeeUser{}
|
|
@@ -239,7 +239,7 @@ func GetEnterpriseUserList(ctx context.Context, pageSize, pageNum int32, conditi
|
|
|
|
|
|
func GetCreatorList(ctx context.Context, pageSize, pageNum int32, conditions *common_model.CreatorListConditions) ([]*http_model.CreatorListPreview, int64, error) {
|
|
func GetCreatorList(ctx context.Context, pageSize, pageNum int32, conditions *common_model.CreatorListConditions) ([]*http_model.CreatorListPreview, int64, error) {
|
|
db := GetReadDB(ctx)
|
|
db := GetReadDB(ctx)
|
|
- db = db.Debug().Model(gorm_model.YoungeeTalentInfo{})
|
|
|
|
|
|
+ db = db.Debug().Model(gorm_model.YoungeeTalentInfo{}).Where("in_blacklist = ?", conditions.InBlacklist)
|
|
// 根据 条件过滤
|
|
// 根据 条件过滤
|
|
conditionType := reflect.TypeOf(conditions).Elem()
|
|
conditionType := reflect.TypeOf(conditions).Elem()
|
|
conditionValue := reflect.ValueOf(conditions).Elem()
|
|
conditionValue := reflect.ValueOf(conditions).Elem()
|
|
@@ -401,3 +401,27 @@ func ModifyAccInfo(ctx context.Context, req *http_model.ModifyAccInfoRequest) er
|
|
UpdatedAdminID: req.User,
|
|
UpdatedAdminID: req.User,
|
|
}).Error
|
|
}).Error
|
|
}
|
|
}
|
|
|
|
+
|
|
|
|
+// 拉黑创作者
|
|
|
|
+func Block(ctx context.Context, data http_model.BlockRequest) error {
|
|
|
|
+ err := Black(ctx, data.ID, data.InBlacklist)
|
|
|
|
+ if err != nil {
|
|
|
|
+ logrus.WithContext(ctx).Errorf("[project] call ChangeProjectStatus error,err:%+v", err)
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ return nil
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+func Black(ctx context.Context, ID string, InBlacklist uint) error {
|
|
|
|
+ db := GetReadDB(ctx)
|
|
|
|
+ talentInfo := gorm_model.YoungeeTalentInfo{}
|
|
|
|
+ if err := db.Debug().Model(&talentInfo).
|
|
|
|
+ Where("id = ?", ID).
|
|
|
|
+ //Updates(gorm_model.YoungeeTalentInfo{InBlacklist: InBlacklist}). //这种方法置0不生效
|
|
|
|
+ UpdateColumn("in_blacklist", InBlacklist).
|
|
|
|
+ Error; err != nil {
|
|
|
|
+ logrus.WithContext(ctx).Errorf("[ChangeProjectStatus] error query mysql total, err:%+v", err)
|
|
|
|
+ return err
|
|
|
|
+ }
|
|
|
|
+ return nil
|
|
|
|
+}
|