# WalkRoomLogoConfigController.java

    package cloud.wconnect.frontoffice.controller.walkroomrequest;

    import cloud.wconnect.commonlib.annotation.ApiId;
    import cloud.wconnect.commonlib.component.SessionContext;
    import cloud.wconnect.frontoffice.entity.walkroomrequest.WalkRoomLogoConfig;
    import cloud.wconnect.frontoffice.pojo.dto.walkroomrequest.WalkRoomLogoConfigDTO;
    import cloud.wconnect.frontoffice.service.walkroomrequest.IWalkRoomLogoConfigService;
    import org.springframework.beans.factory.annotation.Autowired;
    import org.springframework.web.bind.annotation.*;
    import software.amazon.awssdk.utils.ImmutableMap;

    import jakarta.validation.Valid;

    import java.util.Map;
    import java.util.Objects;

    /**
     * <p>
     * Walk Room Requests 功能的logo配置 前端控制器
     * </p>
     *
     * @author lichen
     * @date 2023/7/27
     */
    @RestController
    @RequestMapping("/walk-room-request/logo-config")
    public class WalkRoomLogoConfigController {

        @Autowired
        private SessionContext sessionContext;
        @Autowired
        private IWalkRoomLogoConfigService walkRoomLogoConfigService;

        /**
         * 保存打印logo
         *
         * @param property      资产标识
         * @param logoConfigDTO logo配置dto
         * @return java.util.Map
         * @author lichen
         * @date 2023/7/27
         */
        @ApiId(500)
        @PostMapping
        public Map save(String property, @RequestBody @Valid WalkRoomLogoConfigDTO logoConfigDTO) {
            int propertyId = sessionContext.getPropertyId(property);

            Integer id = walkRoomLogoConfigService.save(propertyId, logoConfigDTO);
            return ImmutableMap.of("id", id);
        }

        /**
         * 查询打印logo
         *
         * @param property 资产标识
         * @return java.util.Map
         * @author lichen
         * @date 2023/7/27
         */
        @ApiId(501)
        @GetMapping
        public Map get(String property) {
            int propertyId = sessionContext.getPropertyId(property);
            //根据资产id查询logo配置
            WalkRoomLogoConfig logoConfig = walkRoomLogoConfigService.getByPropertyId(propertyId);
            if (Objects.nonNull(logoConfig)) {
                return ImmutableMap.of("logo", logoConfig.getLogo());
            } else {
                return ImmutableMap.of("logo", "");
            }
        }

    }