package com.xunhong.erp.turbo.rbac.app.service;

import com.xunhong.erp.turbo.api.rbac.api.UserRoleServiceI;
import com.xunhong.erp.turbo.api.rbac.dto.cmd.UserRoleCreateCmd;
import com.xunhong.erp.turbo.api.rbac.dto.cmd.UserRoleUpdateCmd;
import com.xunhong.erp.turbo.api.rbac.dto.qry.UserRoleListQry;
import com.xunhong.erp.turbo.api.rbac.dto.vo.UserRoleVO;
import com.xunhong.erp.turbo.rbac.app.executor.cmd.UserRoleCreateCmdExe;
import com.xunhong.erp.turbo.rbac.app.executor.cmd.UserRoleListQryExe;
import com.xunhong.erp.turbo.rbac.app.executor.cmd.UserRoleUpdateCmdExe;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.stereotype.Service;

import java.util.List;

@Slf4j
@Service
@DubboService(interfaceClass = UserRoleServiceI.class, version = "1.0.0")
@RequiredArgsConstructor
public class UserRoleServiceImpl implements UserRoleServiceI {
	private final UserRoleListQryExe userRoleListQryExe;
	private final UserRoleCreateCmdExe userRoleCreateCmdExe;
	private final UserRoleUpdateCmdExe userRoleUpdateCmdExe;

	@Override
	public List<UserRoleVO> list(UserRoleListQry userRoleListQry) {
		return userRoleListQryExe.execute(userRoleListQry);
	}

	@Override
	public List<UserRoleVO> create(UserRoleCreateCmd userRoleCreateCmd) {
		return userRoleCreateCmdExe.execute(userRoleCreateCmd);
	}

	@Override
	public List<UserRoleVO> update(UserRoleUpdateCmd userRoleUpdateCmd) {
		return userRoleUpdateCmdExe.execute(userRoleUpdateCmd);
	}
}
