1
luodangjia
2025-01-21 f981c1f30461ef9a40a39338aa77e511ffc24d1f
ruoyi-modules/ruoyi-company/src/main/java/com/ruoyi/company/controller/front/CompanyController.java
@@ -12,6 +12,7 @@
import lombok.RequiredArgsConstructor;
import org.springframework.context.annotation.Lazy;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
@@ -40,4 +41,18 @@
                .eq(Company::getUserId, userId));
        return R.ok(company);
    }
    /**
     * 修改企业信息
     */
    @Operation(summary = "修改企业信息", tags = {"企业端"})
    @PutMapping("/updateCompany")
    public R<Void> updateCompany(Company company){
        Long userId = SecurityUtils.getAppLoginUser().getUserId();
        Company companyDb = companyService.getOne(new LambdaQueryWrapper<Company>()
                .eq(Company::getUserId, userId));
        company.setId(companyDb.getId());
        companyService.updateById(company);
        return R.ok();
    }
}