Java代码学习Day2

Java项目学习

Controller

ApplicationController

CleanCacheController

CompanyController

CompanyListController

  1. Function:Get all company uuid
    public List<String> getAllCompanyUuids() {
        return companyService.listAllCompanyUuids();
    }

where companyService from CompanyService inteface, and its relative function is below:

   @Override
    public List<String> listAllCompanyUuids() {
        List<Company> companyIds = companyMapper.selectAll();
        if (CollectionUtils.isEmpty(companyIds)) {
            return Collections.EMPTY_LIST;
        }
        return companyIds.stream().map(item -> item.getId() + "").collect(Collectors.toList());
    }

Stream java.util.Collection.stream()
Returns a sequential Stream with this collection as its source.

CompanyUserController

  1. Function :ui-api

CompanyV2Controller

  1. Function: Company information management, including get basic information etc.

ConfigEmailController

1.Function: configuration of email, such as save, get, delete and send.

ConfigWorkController

1.Function:Configuration of compnay wechat
redis也同步操作 save, get ,delete

CustomParityController

1.Function:The subsystem abstractions group-related interfaces,including save,queryList, update, queryById, deleteById

GroupController

1.Function: Group-related api

LicenseFetchController

1.Function: License setting

LogoController

1.Function:Operation of logo

NavigationController

1.Function:各项组件的操作,如添加,删除等

NotificationObjectController

1.Function:消息通知类
2.其中一个实现类,如下

    @Override
    public List<NotificationObject> getNotificationObjectById(String company, Long notificationId) {
        return notificationObjectMapper.select(new NotificationObject() {
            {
                setCompanyUuid(company);
                setNotificationId(notificationId);
            }
        });
    }

NotificationObjectController

1.Function:通知对象控制层,获取列表,获取消息通知对象,新增通知对象,删除通知对象
2.功能实现

    @ApiOperation("删除通知对象")
    @DeleteMapping
    public ResponseEntity<Object> delConfig(@RequestParam Long id) {
        notificationObjectService.delObjectUser(id);
        return ResponseEntity.ok().build();
    }

notificationObjectService的实现

    @Override
    public void delObjectUser(Long id) {
        notificationObjectMapper.delete(new NotificationObject() {
            {
                setId(id);
            }
        });
    }

PermissionController

  1. ** Function**:permission
  2. 实现代码
    @PutMapping("/{id}")
    @ApiOperation(value = "修改", notes = "修改")
    public ResponseEntity update(@PathVariable String company, @PathVariable Long id, @RequestBody PermissionVO vo) {
        permissionService.updateByIdAndCompany(company, id, vo);
        return ResponseEntity.status(HttpStatus.CREATED)
                .body(AdminResponse.result(GlobalConstant.SUCCESS, "修改成功!"));
    }

对一个的permissionService的实现如下:

@Override
    public void updateByIdAndCompany(String company, Long id, PermissionVO vo) {
        Example example = new ExamplePlus(Permission.class);
        Example.Criteria criteria = example.createCriteria();
        criteria.andEqualTo("id", id);
        criteria.andEqualTo("companyUuid", company);
        Permission entity = new Permission();
        BeanUtils.copyProperties(vo, entity);
        entity.setUpdateTime(new Date());
        //获取当前用户信息
        BaseUserDetails currentLogin = AuthUtils.getCurrentLogin();
        if (null != currentLogin) {
            entity.setUpdateUser(currentLogin.getUserId());
        }
        permissionMapper.updateByExampleSelective(entity, example);
    }
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值