package com.ywt.service;

import com.ywt.domain.entity.glasses.GlassesSequenceRepository;

import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@DubboService
@Service
public class GlassesIdGenerator {

    @Autowired
    private GlassesSequenceRepository sequenceRepository;

    private final String GOODS_ORDERS_TABLE_NAME = "goods_orders";
    private final String GOODS_ORDERS_DETAIL_TABLE_NAME = "goods_orders_detail";
    private final String POST_ADDRESS_TABLE_NAME = "post_address";

    /**
     * 生成 goods_orders Id
     *
     * @return主键ID
     */
    public int genGoodsOrdersId() {
        return sequenceRepository.gen(GOODS_ORDERS_TABLE_NAME);
    }

    /**
     * 生成 goods_orders_detail Id
     *
     * @return主键ID
     */
    public int genGoodsOrdersDetailId() {
        return sequenceRepository.gen(GOODS_ORDERS_DETAIL_TABLE_NAME);
    }

    /**
     * 生成 post_address Id
     *
     * @return 主键ID
     */
    public int genPostAddressId() {
        return sequenceRepository.gen(POST_ADDRESS_TABLE_NAME);
    }

}
