feat(contract): 添加供应商文件类型相关类及服务实现
添加供应商文件类型枚举、模型、视图模型及服务类 实现供应商文件类型的缓存查询、保存和删除功能
This commit is contained in:
@@ -0,0 +1,39 @@
|
||||
package com.ecep.contract.service;
|
||||
|
||||
import com.ecep.contract.model.CompanyVendorFileTypeLocal;
|
||||
import com.ecep.contract.vm.CompanyVendorFileTypeLocalViewModel;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CachePut;
|
||||
import org.springframework.cache.annotation.Cacheable;
|
||||
import org.springframework.cache.annotation.Caching;
|
||||
import org.springframework.stereotype.Service;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Service
|
||||
@CacheConfig(cacheNames = "vendor-file-type")
|
||||
public class CompanyVendorFileTypeService extends QueryService<CompanyVendorFileTypeLocal, CompanyVendorFileTypeLocalViewModel> {
|
||||
@Cacheable(key = "#p0")
|
||||
@Override
|
||||
public CompanyVendorFileTypeLocal findById(Integer id) {
|
||||
return super.findById(id);
|
||||
}
|
||||
|
||||
@Cacheable(key = "'all'")
|
||||
@Override
|
||||
public List<CompanyVendorFileTypeLocal> findAll() {
|
||||
return super.findAll();
|
||||
}
|
||||
|
||||
@Caching(put = {@CachePut(key = "#p0.id"), @CachePut(key = "'all'")})
|
||||
@Override
|
||||
public CompanyVendorFileTypeLocal save(CompanyVendorFileTypeLocal entity) {
|
||||
return super.save(entity);
|
||||
}
|
||||
|
||||
@Caching(put = {@CachePut(key = "#p0.id"), @CachePut(key = "'all'")})
|
||||
@Override
|
||||
public void delete(CompanyVendorFileTypeLocal entity) {
|
||||
super.delete(entity);
|
||||
}
|
||||
}
|
||||
@@ -1,8 +1,6 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import com.ecep.contract.CompanyCustomerFileType;
|
||||
import com.ecep.contract.CompanyVendorFileType;
|
||||
import com.ecep.contract.model.CompanyCustomerFileTypeLocal;
|
||||
import com.ecep.contract.model.CompanyVendorFileTypeLocal;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
@@ -0,0 +1,11 @@
|
||||
package com.ecep.contract.vm;
|
||||
|
||||
import com.ecep.contract.CompanyVendorFileType;
|
||||
import com.ecep.contract.model.CompanyVendorFileTypeLocal;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
public class CompanyVendorFileTypeLocalViewModel extends EnumViewModel<CompanyVendorFileType, CompanyVendorFileTypeLocal> {
|
||||
}
|
||||
Reference in New Issue
Block a user