package com.zcloud.primeport.service;

import com.alibaba.cola.dto.PageResponse;
import com.alibaba.cola.dto.SingleResponse;
import com.zcloud.primeport.api.PersonMessageServiceI;
import com.zcloud.primeport.command.PersonMessageAddExe;
import com.zcloud.primeport.command.PersonMessageRemoveExe;
import com.zcloud.primeport.command.PersonMessageUpdateExe;
import com.zcloud.primeport.command.query.PersonMessageQueryExe;
import com.zcloud.primeport.dto.PersonMessageAddCmd;
import com.zcloud.primeport.dto.PersonMessagePageQry;
import com.zcloud.primeport.dto.PersonMessageUpdateCmd;
import com.zcloud.primeport.dto.clientobject.PersonMessageCO;
import lombok.AllArgsConstructor;
import org.springframework.stereotype.Service;

/**
 * web-app
 *
 * @Author makejava
 * @Date 2026-03-05 11:33:21
 */
@Service
@AllArgsConstructor
public class PersonMessageServiceImpl implements PersonMessageServiceI {
    private final PersonMessageAddExe personMessageAddExe;
    private final PersonMessageUpdateExe personMessageUpdateExe;
    private final PersonMessageRemoveExe personMessageRemoveExe;
    private final PersonMessageQueryExe personMessageQueryExe;

    @Override
    public PageResponse<PersonMessageCO> listPage(PersonMessagePageQry qry) {

        return personMessageQueryExe.execute(qry);
    }

    @Override
    public SingleResponse add(PersonMessageAddCmd cmd) {

        personMessageAddExe.execute(cmd);
        return SingleResponse.buildSuccess();
    }

    @Override
    public void edit(PersonMessageUpdateCmd personMessageUpdateCmd) {
        personMessageUpdateExe.execute(personMessageUpdateCmd);
    }

    @Override
    public void remove(Long id) {
        personMessageRemoveExe.execute(id);
    }

    @Override
    public void removeBatch(Long[] ids) {
        personMessageRemoveExe.execute(ids);
    }
}

