feyin api

feyin api application

License

License

Categories

Categories

Net
GroupId

GroupId

net.feyin.api
ArtifactId

ArtifactId

feyin-api
Last Version

Last Version

1.0.5
Release Date

Release Date

Type

Type

jar
Description

Description

feyin api
feyin api application
Project URL

Project URL

https://github.com/FeyinPub/feyin-api-java
Source Code Management

Source Code Management

https://github.com/FeyinPub/feyin-api-java.git

Download feyin-api

How to add to project

<!-- https://jarcasting.com/artifacts/net.feyin.api/feyin-api/ -->
<dependency>
    <groupId>net.feyin.api</groupId>
    <artifactId>feyin-api</artifactId>
    <version>1.0.5</version>
</dependency>
// https://jarcasting.com/artifacts/net.feyin.api/feyin-api/
implementation 'net.feyin.api:feyin-api:1.0.5'
// https://jarcasting.com/artifacts/net.feyin.api/feyin-api/
implementation ("net.feyin.api:feyin-api:1.0.5")
'net.feyin.api:feyin-api:jar:1.0.5'
<dependency org="net.feyin.api" name="feyin-api" rev="1.0.5">
  <artifact name="feyin-api" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.feyin.api', module='feyin-api', version='1.0.5')
)
libraryDependencies += "net.feyin.api" % "feyin-api" % "1.0.5"
[net.feyin.api/feyin-api "1.0.5"]

Dependencies

compile (2)

Group / Artifact Type Version
org.apache.httpcomponents : httpclient jar 4.5.3
com.alibaba : fastjson jar 1.2.14

Project Modules

There are no modules declared in this project.

飞印api

飞印开放接口说明文档

文档地址:https://www.showdoc.cc/feyin

使用方法

maven 依赖包

<dependency>
    <groupId>net.feyin.api</groupId>
    <artifactId>feyin-api</artifactId>
    <version>1.0.5</version>
</dependency>

code samples

初始化 client

String memberCode="*********8111e68c6c52540008b6e6"; // 开发帐号,请在http://my.feyin.net 中获取
String apiKey = "*****d12"; //开发密钥,请在http://my.feyin.net 中获取
FeyinClient feyinClient = new FeyinClient(memberCode, apiKey);

发送打印消息

String deviceNo = "4600xxxxxxxxxxxx";

String msg = "需要打印的消息内容"; // 消息排版以及支持的格式请参考 api文档中"打印内容相关"一栏。
int result = feyiniClient.sendMsg(deviceNo, msg);
if(result == 0){
    System.out.println("打印成功");
}

清除未打印消息

FeyinResponse response = feyinClient.clearPendingMsgs(deviceNo); 
if(response.isSuccess()){
    System.out.println("未打印消息已成功清除");
}
else{
    System.err.println(String.format("清除失败,原因:%s", response.getErrMsg()));
}

绑定机器

FeyinResponse response = feyinClient.bindPrinter(deviceNo); // 请注意,本接口针对第三方开发平台,需申请开通
if(response.isSuccess()){
    System.out.println("绑定成功");
}
else{
    System.err.println(String.format("绑定失败,原因:%s", response.getErrMsg()));
}

解绑机器

FeyinResponse response = feyinClient.unbindPrinter(deviceNo); // 请注意,本接口针对第三方开发平台,需申请开通
if(response.isSuccess()){
    System.out.println("解除绑定成功");
}
else{
    System.err.println(String.format("解除绑定失败,原因:%s", response.getErrMsg()));
}

Versions

Version
1.0.5
1.0.4
1.0.3