Ejemplo n.º 1
0
def update_demand_status():
    userId = request_back_helper.current_user_mush_login()["UserId"]

    ApiResponse = api_response.ApiResponse()
    id = request.form.get("id", type=str, default=None)
    IsUndertake = request.form.get("IsUndertake", type=int, default=-1)
    IsTop = request.form.get("IsTop", type=int, default=-1)

    if id is None:
        raise custom_error.CustomFlaskErr(status_code=500, message="参数不正确")
    if IsUndertake == -1:
        raise custom_error.CustomFlaskErr(status_code=500, message="参数不正确")
    if IsTop==-1 :
        raise custom_error.CustomFlaskErr(status_code=500, message="参数不正确")


    if IsUndertake==2:
        sql_list = [demand_service_sql.update_demand_status,
                    demand_service_sql.update_demand_undertake_status]
        args_list = [(IsTop, IsUndertake, userId,id),
                     ( userId,id),]
        mysql.operate__many(sql_list,args_list)
    else :
        mysql.operate_object(demand_service_sql.update_demand_status,(IsTop, IsUndertake, userId,id))

    ApiResponse = api_response.ApiResponse()
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    return api_response.response_return(ApiResponse)
Ejemplo n.º 2
0
def update_browse_service():
    ApiResponse = api_response.ApiResponse()
    Id = request.form.get("Id", type=str, default=None)
    if Id == None or Id == "":
        raise custom_error.CustomFlaskErr(status_code=500,
                                          message="请选择需要修改的需求")
    Name = request.form.get("Name", type=str, default=None)
    if Name == None or Name == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="名称不能为空")
    TimeStart = request.form.get("TimeStart", type=str, default=None)
    TimeEnd = request.form.get("TimeEnd", type=str, default=None)
    if TimeStart == None or TimeStart == "" or TimeEnd == None or TimeEnd == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="起止时间不能为空")
    PriceStart = request.form.get("PriceStart", type=float, default=0.0)
    PriceEnd = request.form.get("PriceEnd", type=float, default=0.0)
    Description = request.form.get("Description", type=str, default=None)
    if Description == None or Description == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="需求描述不能为空")
    ServiceTypeId = request.form.get("ServiceId", type=int, default=0)
    ServiceAreaId = request.form.get("ServiceAreaId", type=int, default=0)
    if ServiceAreaId == 0:
        raise custom_error.CustomFlaskErr(status_code=500, message="服务区域不能为空")
    user = request_helper.current_user_mush_login()
    data = mysql.operate_object(
        demand_service_sql.update_browse_service,
        (Name, ServiceAreaId, ServiceTypeId, PriceStart, PriceEnd, TimeStart,
         TimeEnd, Description, user["Id"], Id, user["Id"]))
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 3
0
def get_current_login_user():
    ApiResponse = api_response.ApiResponse()
    user = request_back_helper.current_user_mush_login()
    ApiResponse.message = "获取成功"
    ApiResponse.status = 200
    ApiResponse.data = user
    return api_response.response_return(ApiResponse)
Ejemplo n.º 4
0
def updateuserinfobyupgrade():
    ApiResponse = api_response.ApiResponse()
    Name = request.form.get("Name", type=str, default=None)
    if Name == None or Name == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="真实姓名不能为空")

    Address = request.form.get("Address", type=str, default=None)
    IDCard = request.form.get("IDCard", type=str, default=None)
    if IDCard == None or IDCard == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="个人证件不能为空")
    IDCardJust = request.form.get("IDCardJust", type=str, default=None)
    IDCardBack = request.form.get("IDCardBack", type=str, default=None)

    ChatNo = request.form.get("ChatNo", type=str, default=None)

    user = request_helper.current_user_mush_login()
    nicheng = user['Name']
    if nicheng is None:
        nicheng = Name

    sql_list = [user_info_sql.update_user_info_by_upgrade]
    args_list = [(Name, Address, IDCard, IDCardJust, IDCardBack, user["Id"],
                  ChatNo, nicheng, user["Id"])]

    data_result = mysql.operate__many(sql_list, args_list)

    if data_result != None and data_result > 0:
        ApiResponse.message = "修改成功"
        ApiResponse.status = 200
        return api_response.response_return(ApiResponse)

    raise custom_error.CustomFlaskErr(status_code=500, message="修改失败")
Ejemplo n.º 5
0
def service_list():
    ApiResponse = api_response.ApiResponse()
    data = mysql.get_list(service_sql.select_service_list, ())
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 6
0
def new_contract():
    ApiResponse = api_response.ApiResponse()
    data = mysql.get_object(user_info_sql.select_new_contract, ())
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 7
0
def update_user_password():
    ApiResponse = api_response.ApiResponse()
    Phone = request.form.get("Phone", type=str, default=None)
    NewPassword = request.form.get("NewPassword", type=str, default=None)
    VCode = request.form.get("VCode", type=str, default=None)
    if Phone == None or Phone == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="手机号码不能为空")
    if NewPassword == None or NewPassword == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="新密码不能为空")
    if VCode == None or VCode == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="验证码不能为空")

    vocde_exists = mysql.get_object(
        verification_code_sql.select_verification_lastcode, (Phone, 2))
    if vocde_exists == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="验证码已失效")
    if vocde_exists["VCode"] != VCode:
        raise custom_error.CustomFlaskErr(status_code=500, message="验证码不正确")
    # 设置验证码已读
    mysql.operate_object(verification_code_sql.update_verificatioin_vcode,
                         (vocde_exists["Id"]))

    data_exce = mysql.operate_object(user_sql.update_user_password,
                                     (NewPassword, Phone))

    if data_exce > 0:
        ApiResponse.message = "修改成功"
        ApiResponse.status = 200
        return api_response.response_return(ApiResponse)

    raise custom_error.CustomFlaskErr(status_code=500, message="修改失败")
Ejemplo n.º 8
0
def back_insert_userinfo():
    ApiResponse = api_response.ApiResponse()
    account = request.form.get("Account", type=str, default=None)
    phone = request.form.get("Phone", type=str, default=None)
    password = request.form.get("Password", type=str, default=None)
    userType = request.form.get("UserType", type=int, default=0)
    name = request.form.get("Name", type=str, default=None)
    realName = request.form.get("RealName", type=str, default=None)
    sex = request.form.get("Sex", type=int, default=0)
    age = request.form.get("Age", type=int, default=0)
    education = request.form.get("Education", type=str, default=None)
    address = request.form.get("Address", type=str, default=None)
    email = request.form.get("Email", type=str, default=None)
    headImage = request.form.get("HeadImage", type=str, default=None)
    if headImage is None or headImage == '':
        headImage = "files/person.jpg"
    IDCard = request.form.get("IDCard", type=str, default=None)
    IDCardJust = request.form.get("IDCardJust", type=str, default=None)
    IDCardBack = request.form.get("IDCardBack", type=str, default=None)
    user = request_back_helper.current_user_mush_login()
    guid = str(uuid.uuid1())
    password = hashlib.md5(password.encode(encoding='gb2312')).hexdigest()

    data_register = user_logic.insert_userinfo(guid, account, phone, password,
                                               userType, name, realName, sex,
                                               age, education, address, email,
                                               headImage, IDCard, IDCardJust,
                                               IDCardBack, user["UserId"])
    if data_register:
        ApiResponse.message = "修改成功"
        ApiResponse.status = 200
        return api_response.response_return(ApiResponse)

    raise custom_error.CustomFlaskErr(status_code=500, message="修改失败")
Ejemplo n.º 9
0
def select_platforminfo():
    ApiResponse = api_response.ApiResponse()

    platforminfo = baseinfo_logic.select_platforminfo()
    Contract = baseinfo_logic.select_contract()
    ApiResponse.data={"platforminfo":platforminfo,"Contract":Contract}
    return api_response.response_return(ApiResponse)
Ejemplo n.º 10
0
def home_login():
    print("home_login")
    ApiResponse = api_response.ApiResponse()
    UserName = request.form.get("UserName", type=str, default=None)
    Password = request.form.get("Password", type=str, default=None)
    if UserName == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="账号不能为空")
    if Password == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="密码不能为空")
    guid = str(uuid.uuid1())
    ip = request.remote_addr
    count = mysql.operate_object(home_sql.update_sysuser_token,
                                 (guid, ip, UserName, Password))
    if count <= 0:
        raise custom_error.CustomFlaskErr(status_code=500, message="账号或密码不正确")
    #写token
    # date = time.strftime("%Y-%m-%d %H:%M:%S", time.localtime())
    user = mysql.get_object(home_sql.select_sysuser_login_info, (guid))
    session["user"] = user
    data = {
        "token": guid,
        "datetime": time.strftime("%Y-%m-%d %H:%M:%S", time.localtime()),
        "user": user
    }
    ApiResponse.message = "登录成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 11
0
def back_updateplanner():
    ApiResponse = api_response.ApiResponse()
    userid = request.form.get("UserId", type=str, default=None)
    account = request.form.get("Account", type=str, default=None)
    phone = request.form.get("Phone", type=str, default=None)
    userType = request.form.get("UserType", type=int, default=0)
    name = request.form.get("Name", type=str, default=None)
    realName = request.form.get("RealName", type=str, default=None)
    sex = request.form.get("Sex", type=int, default=0)
    age = request.form.get("Age", type=int, default=0)
    education = request.form.get("Education", type=str, default=None)
    address = request.form.get("Address", type=str, default=None)
    email = request.form.get("Email", type=str, default=None)
    headImage = request.form.get("HeadImage", type=str, default=None)
    IDCard = request.form.get("IDCard", type=str, default=None)
    IDCardJust = request.form.get("IDCardJust", type=str, default=None)
    IDCardBack = request.form.get("IDCardBack", type=str, default=None)
    ServiceAreaId = request.form.get("ServiceAreaId", type=str, default=None)
    ServiceTypeId = request.form.get("ServiceTypeId", type=str, default=None)
    Sort = request.form.get("Sort", type=int, default=0)
    user = request_back_helper.current_user_mush_login()
    data_register = back_planner_logic.update_planner(
        account, phone, userType, name, realName, sex, age, education, address,
        email, headImage, IDCard, IDCardJust, IDCardBack, ServiceAreaId,
        ServiceTypeId, userid, Sort, user["UserId"])
    if data_register:
        ApiResponse.message = "修改成功"
        ApiResponse.status = 200
        return api_response.response_return(ApiResponse)

    raise custom_error.CustomFlaskErr(status_code=500, message="修改失败")
Ejemplo n.º 12
0
def back_update_education():
    ApiResponse = api_response.ApiResponse()
    Id = request.form.get("Id", type=str, default=None)
    if Id == None or Id == "":
        raise custom_error.CustomFlaskErr(status_code=500,
                                          message="请选择需要修改的学历")
    TimeStart = request.form.get("TimeStart", type=str, default="")
    TimeEnd = request.form.get("TimeEnd", type=str, default="")
    #if TimeStart == None or TimeStart=="" or TimeEnd==None or TimeEnd=="":
    #   raise custom_error.CustomFlaskErr(status_code=500, message="起止时间不能为空")
    University = request.form.get("University", type=str, default=None)
    if University == None or University == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="毕业学校不能为空")
    Degree = request.form.get("Degree", type=str, default=None)
    if Degree == None or Degree == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="学位不能为空")
    Sort = request.form.get("Sort", type=int, default=0)
    user = request_back_helper.current_user_mush_login()
    data = back_planner_logic.update_education(TimeStart, TimeEnd, University,
                                               Degree, Sort, Id,
                                               user["UserId"])
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 13
0
def agree_join_team():
    ApiResponse = api_response.ApiResponse()
    userId = request_helper.current_user_mush_login()["Id"]

    NoticeId = request.form.get("NoticeId", type=str, default=None)
    if NoticeId is None or NoticeId == '':
        raise custom_error.CustomFlaskErr(status_code=500,
                                          message="团队通知id不能为空")

    exists_team = mysql.get_object(team_sql.exists_team_peoper_bynoticeid,
                                   (NoticeId))

    if exists_team is not None and exists_team["IsAdmin"] != 1:
        raise custom_error.CustomFlaskErr(status_code=500, message="您不是团队管理员")
    if exists_team is None or exists_team["Status"] != 1:
        raise custom_error.CustomFlaskErr(status_code=500,
                                          message="您没有需要审核的团队消息")
    sql_list = [
        team_sql.insert_team_member, team_sql.update_team_admin_notice,
        team_sql.update_team_notice, team_sql.update_planner_statistics
    ]
    args_list = [(exists_team["TeamId"], exists_team["duUserId"], userId),
                 (userId, NoticeId), (userId, exists_team["UnionId"]),
                 (exists_team["TeamId"], userId, exists_team["duUserId"])]
    resultInt = mysql.operate__many(sql_list, args_list)
    if resultInt <= 0:
        raise custom_error.CustomFlaskErr(status_code=500, message="审批失败")
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    return api_response.response_return(ApiResponse)
Ejemplo n.º 14
0
def get_vcode():
    Phone = request.form.get("Phone", type=str, default=None)
    if Phone == None or Phone == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="手机号码不能为空")

    CodeType = request.form.get("CodeType", type=int, default=None)
    if CodeType == None or CodeType == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="短信类型不能为空")

    vcode = str(random.randint(0, 9))
    vcode += str(random.randint(0, 9))
    vcode += str(random.randint(0, 9))
    vcode += str(random.randint(0, 9))

    ApiResponse = api_response.ApiResponse()
    data = mysql.operate_object(
        verification_code_sql.insert_verification_codel,
        (Phone, vcode, CodeType))
    if data != None and data > 0:
        params = {"vcode": vcode}
        send_result = aliyun_sms.AliyunSMS().send_single(
            phone=Phone, sign="龟划海外", template='SMS_85970044', params=params)
    ApiResponse.message = "成功"
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 15
0
def quit_team():
    ApiResponse = api_response.ApiResponse()
    userId = request_helper.current_user_mush_login()["Id"]

    TeamId = request.form.get("TeamId", type=str, default=None)
    if TeamId is None or TeamId == '':
        raise custom_error.CustomFlaskErr(status_code=500, message="团队id不能为空")
    is_team_admin = mysql.get_object(team_sql.is_team_admin, (TeamId, userId))
    if (is_team_admin["total"] > 0):  # 是团队管理员,解散团队
        sql_list = [
            team_sql.disband_team1, team_sql.disband_team2,
            team_sql.update_planner_statistics_null,
            team_sql.delete_team_notice_admin
        ]
        args_list = [(userId, TeamId, userId), (userId, TeamId), (userId),
                     (TeamId)]
        resultInt = mysql.operate__many(sql_list, args_list)
    else:
        sql_list = [
            team_sql.quit_team, team_sql.update_planner_statistics_null,
            team_sql.delete_team_notice
        ]
        args_list = [(userId, TeamId, userId), (userId), (userId, TeamId)]
        resultInt = mysql.operate__many(sql_list, args_list)
    if resultInt <= 0:
        raise custom_error.CustomFlaskErr(status_code=500, message="退出团队失败")
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    return api_response.response_return(ApiResponse)
Ejemplo n.º 16
0
def demand_service_info():
    ApiResponse = api_response.ApiResponse()
    demandServiceId = request.form.get("demandServiceId",
                                       type=str,
                                       default=None)
    if demandServiceId == None and demandServiceId == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="需求或者服务不存在")
    data = mysql.get_object(demand_service_sql.select_demand_service_info,
                            (demandServiceId))
    collection_count = 0
    undertake_count = 0
    user = request_helper.current_user()
    if user != None and any(
            user) and data != None:  #and user["Id"]!=data["UserId"]:
        obj = demand_service_logic.get_whether_collection(
            user["Id"], demandServiceId)
        collection_count = obj["collection_count"]
        data_exists = mysql.get_object(
            demand_undertake.select_exists_demand_service,
            (demandServiceId, user["Id"]))
        undertake_count = data_exists["total"]
    data["collection_count"] = collection_count
    data["isfllow"] = collection_count
    data["undertake_count"] = undertake_count
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 17
0
def upgrade_user():
    ApiResponse = api_response.ApiResponse()
    Sex = request.form.get("Sex", type=int, default=0)
    if Sex == 0:
        raise custom_error.CustomFlaskErr(status_code=500, message="性别不能为空")
    Name = request.form.get("Name", type=str, default=None)
    if Name == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="真实姓名不能为空")
    Address = request.form.get("Address", type=str, default=None)
    if Address == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="地址不能为空")
    ServiceId = request.form.get("ServiceId", type=str, default=None)
    if ServiceId == None or ServiceId == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="服务不能为空")
    ServiceAreaId = request.form.get("ServiceAreaId", type=str, default=None)
    if ServiceAreaId == None or ServiceAreaId == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="服务区域不能为空")
    Email = request.form.get("Email", type=str, default=None)
    if Email == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="邮箱不能为空")
    Experience = request.form.get("Experience", type=str, default=None)
    if Experience == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="资历不能为空")
    IDCard = request.form.get("IDCard", type=str, default=None)
    if IDCard == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="身份证不能为空")
    IDCardPic = request.form.get("IDCardPic", type=str, default=None)
    if IDCardPic == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="身份证正面不能为空")
    IDCardBackPic = request.form.get("IDCardBackPic", type=str, default=None)
    if IDCardBackPic == None:
        raise custom_error.CustomFlaskErr(status_code=500, message="身份证反面不能为空")

    userId = request_helper.current_user_mush_login()["Id"]

    nicheng = request_helper.current_user_mush_login()["Name"]
    if nicheng is None:
        nicheng = Name

    data_exists = mysql.get_list(user_upgrade.select_exists_upgrade, (userId))

    if len(data_exists):
        raise custom_error.CustomFlaskErr(status_code=500,
                                          message="你已经存在申请过注册规划师")

    argData = [(userId, Sex, Name, Address, ServiceId, ServiceAreaId, Email,
                Experience, IDCardPic, userId, IDCardBackPic, IDCard),
               (nicheng, userId)]

    argSql = (user_upgrade.insert_upgrade_user,
              user_upgrade.update_user_info_name)

    data_register = mysql.operate__many(argSql, argData)

    if data_register > 0:
        ApiResponse.message = "申请成功"
        ApiResponse.status = 200
        return api_response.response_return(ApiResponse)
    raise custom_error.CustomFlaskErr(status_code=500, message="申请失败")
Ejemplo n.º 18
0
def select_permission_list():
    ApiResponse = api_response.ApiResponse()
    user = request_back_helper.current_user_mush_login()
    data = sys_role_logic.select_permission_list(user["UserId"])
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 19
0
def select_dynamic_info():
    ApiResponse = api_response.ApiResponse()
    dynamicId = request.form.get("dynamicId", type=int, default=None)
    dynamic = dynamic_logic.select_dynamic_info(dynamicId)
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = dynamic
    return api_response.response_return(ApiResponse)
Ejemplo n.º 20
0
def service():
    ApiResponse = api_response.ApiResponse()
    count = request.form.get("count", type=int, default=5)
    data = mysql.get_list(service_sql.select_top_service, (count))
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 21
0
def delete_sys_user():
    ApiResponse = api_response.ApiResponse()
    user_id= request.form.get("user_id", type=str, default=None)
    user = request_back_helper.current_user_mush_login()
    data_register =  sys_user_logic.delete_sys_user(user_id, user["UserId"])
    ApiResponse.message = "删除成功"
    ApiResponse.status = 200
    return api_response.response_return(ApiResponse)
Ejemplo n.º 22
0
def system_error(error):
    # 部署时需要去掉error.args[1]
    message = ""
    if len(error.args) > 1:
        message = error.args[1]
    else:
        message = error.args[0]
    ApiResponse = api_response.ApiResponse(message, 500, "系统错误")
    return api_response.response_return(ApiResponse)
Ejemplo n.º 23
0
def insert_dynanic():
    ApiResponse = api_response.ApiResponse()
    content = request.form.get("content", type=str, default=None)
    imageUrl = request.form.get("imageUrl", type=str, default=None)
    user = request_helper.current_user_mush_login()
    data = dynamic_logic.insert_dynanic(user["Id"], content, imageUrl)
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    return api_response.response_return(ApiResponse)
Ejemplo n.º 24
0
def select_dynamic_list():
    ApiResponse = api_response.ApiResponse()
    size = request.form.get("size", type=int, default=10)
    page = request.form.get("page", type=int, default=1)
    data = dynamic_logic.select_dynamic_list(page, size)
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 25
0
def cooperation():
    ApiResponse = api_response.ApiResponse()
    size = request.form.get("size", type=int, default=10)
    page = request.form.get("page", type=int, default=1)
    data = mysql.get_list(platform_sql.select_platform_cooperation, ((page-1)*size,size))
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 26
0
def get_config_list():
    ApiResponse = api_response.ApiResponse()
    Key = request.form.get("Key", type=str, default=None)
    if Key is None or Key == "":
        raise custom_error.CustomFlaskErr(status_code=500, message="key不能为空")
    data = mysql.get_object(basic_sql.get_config_list, (Key))
    ApiResponse.message = "成功"
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 27
0
def select_user_role_list():
    ApiResponse = api_response.ApiResponse()
    user_id = request.form.get("user_id", type=str, default=None)
    user = request_back_helper.current_user_mush_login()
    data = sys_role_logic.select_user_role_list(user_id, user["UserId"])
    ApiResponse.message = "成功"
    ApiResponse.status = 200
    ApiResponse.data = data
    return api_response.response_return(ApiResponse)
Ejemplo n.º 28
0
def select_sys_role_info():
    ApiResponse = api_response.ApiResponse()
    role_id = request.form.get("role_id", type=int, default=None)
    user = request_back_helper.current_user_mush_login()
    roleinfo = sys_role_logic.select_sys_role_info(role_id)
    if roleinfo != None and any(roleinfo):
        ApiResponse.data = roleinfo
        return api_response.response_return(ApiResponse)
    raise custom_error.CustomFlaskErr(status_code=500, message="角色不存在")
Ejemplo n.º 29
0
def select_sys_user_info():
    ApiResponse = api_response.ApiResponse()
    user_id = request.form.get("user_id", type=str, default="")
    user = request_back_helper.current_user_mush_login()
    userinfo = sys_user_logic.select_sys_user_info(user_id)
    if userinfo !=None and any(userinfo):
        ApiResponse.data=userinfo
        return api_response.response_return(ApiResponse)
    raise custom_error.CustomFlaskErr(status_code=500, message="用户不存在")
Ejemplo n.º 30
0
def get_login_user():
    ApiResponse = api_response.ApiResponse()
    user = request_helper.current_user_mush_login()
    if any(user):
        ApiResponse.message = "成功"
        ApiResponse.status = 200
        ApiResponse.data = user
        return api_response.response_return(ApiResponse)
    raise custom_error.CustomFlaskErr(status_code=600, message="请先登录")