Skip to content

Commit

Permalink
Merge pull request #15 from bugkingK/master
Browse files Browse the repository at this point in the history
fffff
  • Loading branch information
boran0329 authored Jun 20, 2018
2 parents 172430e + aba65ba commit 5aebe4c
Show file tree
Hide file tree
Showing 14 changed files with 103 additions and 82 deletions.
Binary file modified .DS_Store
Binary file not shown.
158 changes: 88 additions & 70 deletions .idea/workspace.xml

Large diffs are not rendered by default.

Binary file modified BVC-WEB/.DS_Store
Binary file not shown.
8 changes: 4 additions & 4 deletions BVC-WEB/BVC.sol
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,10 @@ contract BVC {

// 투표를 진행. getCheckVoted에서 true를 반환받았을 때에만 실행할 수 있어야 함.
function setVote(uint _placeID, uint _candidateID, uint _phone) {
// voterList.length += 1;
// uint index = voterList.length - 1;
// voterList[index].phone = _phone;
// voterList[index].votedPlace = _placeID;
voterList.length += 1;
uint index = voterList.length - 1;
voterList[index].phone = _phone;
voterList[index].votedPlace = _placeID;
for (uint i = 0; i < candidateList.length; i++) {
if(candidateList[i].candidateID == _candidateID) {
candidateList[i].voteCount += 1;
Expand Down
Binary file added BVC-WEB/config/.DS_Store
Binary file not shown.
6 changes: 3 additions & 3 deletions BVC-WEB/config/blockChain.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,12 +15,12 @@ var abiDefinition = JSON.parse(compiledCode.contracts[':BVC'].interface);

// eth를 지불할 eth지갑을 선택합니다.
web3.eth.defaultAccount = web3.eth.accounts[0];

// sol파일의 컨트랙트 주소입니다.
var contractAddress = '0xdcefd97b84e2208fc4b0cdf38a2adb4de853e8ff';

var contractAddress = '0x53e22abb33fbfd970e86f087722fbf1deefd8e92';
//var gaslimit = '9999999999';
// 컨트랙트를 연결합니다.
var contract = web3.eth.contract(abiDefinition);
var BVC = contract.at(contractAddress);


module.exports = BVC;
2 changes: 1 addition & 1 deletion BVC-WEB/model/blockFunc.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ module.exports.setCandidate = function(placeid, result) {

// 5. 투표하는 메소드입니다.
module.exports.setVote = function(placeid, candidateid, phone, result) {
BVC.setVote(placeid, candidateid, phone, function(err, res) {
BVC.setVote.sendTransaction(placeid, candidateid, phone, {gas: 900000, gasPrice: 1}, function(err, res) {
if(!err) {
result(null, res);
} else {
Expand Down
Binary file modified BVC-iOS/BVC-iOS/Images.xcassets/.DS_Store
Binary file not shown.
4 changes: 2 additions & 2 deletions BVC-iOS/BVC-iOS/Model/Network.swift
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ class APIClient {
return
}
// 임시용 imageURL
let imageURL = "http://yangarch.iptime.org/bvc/placeimg/p3"
let imageURL = "http://yangarch.iptime.org/voteweb/wp-content/uploads/2018/06/\(candidateid).png"
// 임시용 pdfURL
let pdfURL = "http://yangarch.iptime.org/bvc/candidateimg/comm/1moon.pdf"

Expand Down Expand Up @@ -253,7 +253,7 @@ class APIClient {
return
}
// 임시용 imageURL
let imageURL = "http://yangarch.iptime.org/bvc/placeimg/p3"
let imageURL = "http://yangarch.iptime.org/voteweb/wp-content/uploads/2018/06/\(candidateid).png"

let countinginfo = CountingInfo(name: name, placeid: placeid, candidateid: candidateid, voteCount: voteCount, imageURL: imageURL)
countingInfo.append(countinginfo)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class ReportViewController: UIViewController {
func getCounting(placeid: String) {
let api = APIClient()
api.getCounting(placeid: placeid) { response in
print(response)
self.countingInfo.removeAll()
self.countingInfo = response
self.collectionView.reloadData()
}
Expand All @@ -78,7 +78,7 @@ extension ReportViewController: UICollectionViewDataSource {
let cell = collectionView.dequeueReusableCell(withReuseIdentifier: reuseIdentifier, for: indexPath) as! ReportViewCell

cell.configure(
imageURL: "http://yangarch.iptime.org/bvc/placeimg/p3",
imageURL: countingInfo[indexPath.row].imageURL,
candidateName: countingInfo[indexPath.row].name,
voteCount: countingInfo[indexPath.row].voteCount)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ class VoteStatusViewController: UIViewController {

let apiClient = APIClient()
apiClient.getEndedPlace() { response in
self.endedPlaceinfo.removeAll()
self.endedPlaceinfo = response
self.collectionView.reloadData()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ class CandidateViewController: UIViewController {

let apiClient = APIClient()
apiClient.getBookedCandidate(placeid: selectedPlaceid) { response in
self.candidateInfo.removeAll()
self.candidateInfo = response
self.collectionView.reloadData()
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class VoteListViewController: UIViewController{

let apiClient = APIClient()
apiClient.getStartedPlace() { response in
self.startedPlaceinfo.removeAll()
self.startedPlaceinfo = response
self.collectionView.reloadData()
}
Expand Down
Binary file not shown.

0 comments on commit 5aebe4c

Please sign in to comment.