
package com.tmerclub.cloud.biz.feign;

import com.tmerclub.cloud.api.biz.feign.AttachFileFeignClient;
import com.tmerclub.cloud.biz.service.AttachFileGroupService;
import com.tmerclub.cloud.biz.service.AttachFileService;
import com.tmerclub.cloud.common.response.ServerResponseEntity;
import com.tmerclub.cloud.common.security.AuthUserContext;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;

/**
 * @Author lth
 * @Date 2021/7/23 10:30
 */
@DubboService
public class AttachFileFeignController implements AttachFileFeignClient {

    @Autowired
    private AttachFileService attachFileService;
    @Autowired
    private AttachFileGroupService attachFileGroupService;

    @Override
    public ServerResponseEntity<Void> updateShopIdByUid(Long shopId) {
        attachFileService.updateShopIdByUid(shopId, AuthUserContext.getAccountUid());
        attachFileGroupService.updateShopIdByUid(shopId, AuthUserContext.getAccountUid());
        return ServerResponseEntity.success();
    }

    @Override
    public ServerResponseEntity<String> getfileTypeByfilePath(String filePath) {
        return ServerResponseEntity.success(attachFileService.getfileTypeByfilePath(filePath));
    }

}
