Ejemplo n.º 1
0
        public ResponseResult <byte[]> SaveToBytes(BarCodeCreateInput barCodeCreateInput)
        {
            BarCodeCreateEntity barCodeCreateEntity = BarCodeConvert.ChangeEntity(barCodeCreateInput);

            byte[] result = BarCodeHelper.SaveCodeToBytes(barCodeCreateEntity);
            return(ResponseResult <byte[]> .Success(result));
        }
Ejemplo n.º 2
0
        public ResponseResult Test(BarCodeCreateInput barCodeCreateInput)
        {
            BarCodeCreateEntity barCodeCreateEntity = BarCodeConvert.ChangeEntity(barCodeCreateInput);
            string filename = BarCodeHelper.SaveCode(barCodeCreateEntity);

            return(ResponseResult.Success($"条形码存储成功:{filename}"));
        }
Ejemplo n.º 3
0
        public ResponseResult <string> SaveToBase64(BarCodeCreateInput barCodeCreateInput)
        {
            BarCodeCreateEntity barCodeCreateEntity = BarCodeConvert.ChangeEntity(barCodeCreateInput);
            string result = BarCodeHelper.SaveCodeToBase64(barCodeCreateEntity);

            return(ResponseResult <string> .Success(result));
        }
Ejemplo n.º 4
0
        public static BarCodeCreateEntity ChangeEntity(BarCodeCreateInput item)
        {
            BarCodeCreateEntity barCodeCreateEntity = new BarCodeCreateEntity
            {
                ContextText = item.ContextText
            };

            if (item.Width != 0)
            {
                barCodeCreateEntity.Width = item.Width;
            }
            if (item.Height != 0)
            {
                barCodeCreateEntity.Height = item.Height;
            }
            if (!string.IsNullOrWhiteSpace(item.BackColor))
            {
                barCodeCreateEntity.BackColor = item.BackColor;
            }
            if (!string.IsNullOrWhiteSpace(item.ForeColor))
            {
                barCodeCreateEntity.ForeColor = item.ForeColor;
            }

            return(barCodeCreateEntity);
        }
Ejemplo n.º 5
0
 public ResponseResult <string> SaveToBase64([FromBody] BarCodeCreateInput barCodeCreateInput)
 {
     return(_barCodeDomain.SaveToBase64(barCodeCreateInput));
 }
Ejemplo n.º 6
0
 public ResponseResult <byte[]> SaveToBytes([FromBody] BarCodeCreateInput barCodeCreateInput)
 {
     return(_barCodeDomain.SaveToBytes(barCodeCreateInput));
 }
Ejemplo n.º 7
0
 public ResponseResult Test([FromBody] BarCodeCreateInput barCodeCreateInput)
 {
     return(_barCodeDomain.Test(barCodeCreateInput));
 }